Deleted:Creating loop for read groups using Picard
0
0
Entering edit mode
13 months ago

I am trying to use the following code to add read groups to a set of six files, however, I keep getting error messages. I am horrible at writing bash scripts since I've only really started doing this about a month ago, so any help is much appreciated!

bams=/data/Bamfiles

    for file in $bams/*_md.bam
        do
            java -jar $picard AddOrReplaceReadGroups INPUT=$bams OUTPUT=${bams%_md.bam}_RG.bam RGPU=AB6723 RGID=${file%_md.bam} RGPL=Illumina RGLB=PAIRED RGSM=${file%_md.bam}
            samtools index ${mdbam%_md.bam}_RG.bam
    done

Errors: [E::hts_open_format] fail to open file '/data/Bamfiles/PF203_RG.bam'

samtools index: failed to open "/data/Bamfiles/PF203_RG.bam": No such file or directory

bash picard loop • 503 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 3081 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6