Entering edit mode
4.4 years ago
vanessagpds
▴
10
Hello everyone, I am new to bioinformatics. I have several files in BAM format and I want to convert them to fastq using samtools.
Is there any way to convert them all at once?
I tried : samtools fastq * .bam > * .fastq but it was failure.
try this with parallel:
parallel --dry-run 'samtools fastq {} > {.}.fastq' ::: *.bam
Hi e.ortiz.v
Your answer is so helpful. I have a question that
if I have abc.bam and I would like to remove .bam and add nothing and get abs. after that, I will add abs to the string of is it ok to write it in this way
if I just remove and keep the file name
A= test_1.fq.gz -R "@RG\tID:1\tSM:${A[i]//_1.fq.gz}"
result is
-R "@RG\tID:1\tSM: test"
is it correct?
Hi E. Ortiz,
I would like to ask you, please, if would it be possible a similar code for simultaneously to convert many fastq files to respective bam files?. Could you write that code ?. I was trying the above code changing fastq by bam and vice versa, but it doesn't work for me.
Thank you very much.