1
$\begingroup$

10x Genomics data are stored in three FASTQ files, besides the standard R1 and R2 reads, there is also a I1 file with some metadata. Sometimes however they are shipped in a single bam/cram file (e.g. the data from the Darwin Tree of Life). How can I convert the BAM or CRAM files to FASTQ?

-- edit --

Apparently, the I3 file is not 10x specific thing. It is an index generated when demultiplexing any Illumina data. See this question for a nice explanation.

$\endgroup$
4
  • $\begingroup$ What is "10x data"? $\endgroup$
    – terdon
    Jun 8 at 17:28
  • $\begingroup$ Isn't I1 the index read not unique to 10x data? But normally demultiplexing Illumina data with bcl2fastq does not generate these reads with default arguments $\endgroup$ Jun 8 at 20:12
  • $\begingroup$ @Chris_Rands (after a bit of googling) you are right. I just not aware of its existence before I run into this question on the tDToL GitHub. And then I thought I might as well put it here so it's easier to google it. $\endgroup$
    – Kamil S Jaron
    Jun 8 at 22:44
  • $\begingroup$ @terdon it's a type of library prep that allows long range sequencing of mate pairs. The name is weird, I fixed the link, that will hopefully help. $\endgroup$
    – Kamil S Jaron
    Jun 8 at 22:50
2
$\begingroup$

All can be done with samtools. This is how the Darwin Tree of Life folks convert it:

samtools fastq -@4 -i \
  -1 ${sample}_S${tag}_L%03s_R1_001.fastq.gz \
  -2 ${sample}_S${tag}_L%03s_R2_001.fastq.gz \
  --i1 ${sample}_S${tag}_L%03s_I1_001.fastq.gz \
  --index-format i8 ${lane}.cram
$\endgroup$
4
  • $\begingroup$ I don't know if that solution will work with 10xGenomics files. You have to recreate R2 out of the contents of tags; there will be no reads with the read2 binary flag set. $\endgroup$
    – swbarnes2
    Jun 9 at 19:41
  • $\begingroup$ @swbarnes2 I just have seen this thread: github.com/darwintreeoflife/darwintreeoflife.data/issues/… and tried to make it more googlable (because I do think there will be quite a few people who will be downloading the tDToL data). $\endgroup$
    – Kamil S Jaron
    Jun 10 at 9:39
  • $\begingroup$ I saw that thread too. I don't think it's right. samtools fastq -2 will work fine for bams from many applications, but not 10XGenomics. $\endgroup$
    – swbarnes2
    Jun 10 at 16:45
  • $\begingroup$ @kamil, can you post a couple of lines of the BAM file showing how tags for R1 and R2 appear in 10x data? I can probably quite easily add support for this in genozip.com/sam2fq.html $\endgroup$
    – Divon
    Jul 25 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.