This is a test version of Biostars. For the public version, visit https://www.biostars.org.
correct fastq files for the expression analysis

I am planning to perform expression analysis on RNAseq data but instead of fastq files, I received cram files. I used samtools to convert cram to fastq files. if you have experience, would you please let me know if the resulting fastq would have any differences with the original fastq files (I do not have access to the original fastq files). here is the command I used:

samtools view -b -T test.cram > test.bam
samtools fastq -1 test_R1.fastq.gz -2 test_R2.fastq.gz  test.bam
cram

You should name sort (samtools sort -n or samtools collate) the BAM files before converting to fastq. If your CRAM file did not include unmapped reads then you will not be able to get those. Fastq data you end up with should be identical to information in your CRAM file.

Since cram is reference based format, my understanding is that user must know the reference file used in generating cram and the same should be supplied in generating bam.

I would not create cram files without reference (First caveat) nor do I recommend it. If service/cram provider does that, no comments on that.

Second caveat works only if reference file is located as per UR field, on OP machine/network path/public URL. Since it is from a third party, I think samtools may not be able to find the reference. Otherwise, user has to provide by -T.

If OP could post UR field from cram file, it would help better understanding the location of reference file used in cram file.

0 answers

No answers yet.

Log in to answer this question.