Entering edit mode
5.2 years ago
phylofun
▴
50
I want to do a for loop around the picard tool, AddOrReplaceReadGroups, but I get an error that has something to do with my input and output paths (I think). Can someone tell me where I went wrong with this:
# pwd: /Users/phylofun/Downloads/project
for i in mapping/*-pe.bam;
do
java -jar ~/miniconda2/jar/AddOrReplaceReadGroups.jar \
I="$i" \
SORT_ORDER=coordinate \
RGPL=illumina \
RGPU=D109LACXX \
RGLB=Lib1 \
RGID="${i%-pe.bam}" \
RGSM="${i%-pe.bam}" \
VALIDATION_STRINGENCY=LENIENT \
O=picard/"${i%-pe.bam}-pe-RG.bam"
done
error: Cannot write file: /Users/phylofun/Downloads/project/picard/mapping/sample1-pe-RG.bam. Neither file nor parent directory exist.
Welcome to Biostars and thank you for the contribution! Please use the formatting bar (especially the
code
option) to present your post better. You can use backticks (`text` becomestext
) for inline code, or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.