unmapped reads from 10X visium spaceranger bam file
1
0
Entering edit mode
2.8 years ago

Hello everyone

I have 10X spatial transcriptome data from four samples (2 treated and 2 untreated). For 2 samples, transcriptome mapping rate is very less (< 30 %). Next I wanted to see sequence statistics of unmapped reads from bam file generated by spaceranger . I followed these steps :

1) extraction of unmapped reads

samtools view -f 4 possorted_genome.bam > possorted_genome_bam_unmapped.bam (file size 4 gb).

2) conversion of bam to fastq

bedtools bamtofastq -i possorted_genome_bam_unmapped.bam -fq unmapped_R1.fq -fq2 unmapped_R2.fq (0 bytes).

Last step gave me empty .fq files.

I would appreciate all the suggestions.

transcriptome 10X spatial visium • 1.5k views
ADD COMMENT
0
Entering edit mode
2.8 years ago

https://bedtools.readthedocs.io/en/latest/content/tools/bamtofastq.html

-fq2 Creating two FASTQ files for paired-end sequences. When using this option, it is required that the BAM file is sorted/grouped by the read name. This keeps the resulting records in the two output FASTQ files in the same order. One can sort the BAM file by query name with samtools sort -n -o aln.qsort.bam aln.bam.

ADD COMMENT
0
Entering edit mode

I tried to process my bam files as follows :

samtools sort -n -o possorted_genome_bam.qsort.unmapped.bam possorted_genome_bam_unmapped.bam

bedtools bamtofastq -i possorted_genome_bam_unmapped.bam -fq unmapped_R1.fq -fq2 unmapped_R2.fq

But still its giving me empty .fq files.

ADD REPLY
0
Entering edit mode

what is the output of

samtools view possorted_genome_bam_unmapped.bam | head
ADD REPLY
0
Entering edit mode

Here is the output :

A00556:201:HLTVVDRXY:2:1101:1063:2268   4   *   0   0   *   *0  0   AAGCAGTGGTATCAAACGCAGAGTACATGGGTGCGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAGAAAAAGAATAAAAAAAAAAAATAA FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFF,FFFFFFFFFFFFFFFF:,FFFF,FFF,,F:F,:F:,,F::::,:,F:FF,:F,,F:,::F,F,:::,,:FF:FF,,,F,F,,,,:F,:,:,,:,,:,,,,NH:i:0   HI:i:0  AS:i:86 nM:i:1  uT:A:1  xf:i:0  ts:i:28 li:i:0  BC:Z:TGCGCGGTTTQT:Z:FFFFFFFFFF  CR:Z:CGCGCATGTTTGATTG   CY:Z:FFFFFFFFFFFFFFFF   CB:Z:CGCGCATGTTTGATTG-1 UR:Z:CTACTCTTGTAC   UY:Z:FFFFFFFFFFFF   UB:Z:CTACTCTTGTAC   RG:Z:S3_C1_Complete:0:1:HLTVVDRXY:2
A00556:201:HLTVVDRXY:2:1101:1063:3051   4   *   0   0   *   *0  0   AAGCAGTGGTATCAACGCAGAGTACATGGAAAAAAAATTCTTTTAATGTGGAAACAATAAATTTCACAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,:FFFFFFFF:F:FFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFF:F:F::FF:FFFFFFFFFFF::FFFFFFFFF,::FFF:F:F:F,F:F:F:FF::F::F::,:FF,FF,NH:i:0   HI:i:0  AS:i:82 nM:i:2  uT:A:1  xf:i:0  ts:i:27 li:i:0  BC:Z:TGCGCGGTTTQT:Z:FFFFFFFFFF  CR:Z:TTGGATATCGTCTACG   CY:Z:FFFFFFFFFFFFFFFF   CB:Z:TTGGATATCGTCTACG-1 UR:Z:GCTTGTGTTGTC   UY:Z:FFFFFFFFFFFF   UB:Z:GCTTGTGTTGTC   RG:Z:S3_C1_Complete:0:1:HLTVVDRXY:2
A00556:201:HLTVVDRXY:2:1101:1063:3552   4   *   0   0   *   *0  0   AAGCAGTGGTATCAACGCAGAGTAATGGGGAGTGCGGGTAGGAGCCGTGAGGTGCTTCTCTGCTGTGACAAACGACCCTGTCTGTCCGTGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FF::FF,FF:FFFFFF::FFF:,FFFFFFFF::FFFFF:,:FFFFFF:FF,,::F,FFFF:FFFFF:FFFFFFFFFFFFF,FFFFF:FFFF:::FFFFFFFFFFFFFFFFF,F,FFFF:FFFFFFF:F::F,,,:F,,,,F,,F,:,,FF,NH:i:0   HI:i:0  AS:i:62 nM:i:0  uT:A:1  xf:i:0  ts:i:27 li:i:0  BC:Z:TGCGCGGTTTQT:Z:FFFF,:FFF,  CR:Z:AGAAGTGATTCGTGAT   CY:Z:,FFFFFFFFFFFFFFF   CB:Z:AGAAGTGATTCGTGAT-1 UR:Z:ACCGGAAGTATA   UY:Z:FF:FFFFFFFFF   UB:Z:ACCGGAAGTATA   RG:Z:S3_C1_Complete:0:1:HLTVVDRXY:2
A00556:201:HLTVVDRXY:2:1101:1063:3709   4   *   0   0   *   *0  0   AAGCAGTGGTATCAACGCAGAGTACATGGGCCCTGGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,F,FFFFF::FFFFF,FF,FFF:FFFFF,FFFF,FF::FFF,F,:,F:F,:FF,:,:FF,F,NH:i:0   HI:i:0  AS:i:102    nM:i:0  uT:A:3  xf:i:0  ts:i:30 li:i:0  BC:Z:TGCGCGGTTT QT:Z:FFFFFFFFFF CR:Z:GTTGAACCGGTTCCAT   CY:Z:FFFFFFFFFFFFFFFF   CB:Z:GTTGAACCGGTTCCAT-1 UR:Z:TACGGGATAGTT   UY:Z:F:FFFF:FFFFF   UB:Z:TACGGGATAGTT   RG:Z:S3_C1_Complete:0:1:HLTVVDRXY:2
A00556:201:HLTVVDRXY:2:1101:1063:4617   4   *   0   0   *   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TTCAAGGCAG-1 UR:Z:CTCCCTCGCGCA   UY:Z::F,FFFFFFFFF   UB:Z:CTCCCTCGCGCA   RG:Z:S3_C1_Complete:0:1:HLTVVDRXY:2
A00556:201:HLTVVDRXY:2:1101:1063:5932   4   *   0   0   *   *0  0   AAGCAGTGGTATCAACGCAGAGTACATGGGAAAAGTGAATCTTTGCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFF,F,FFFFFF,F::FFFFFFFFFFFFF:FFFF::FFFF:FF:,,FFFF:FFFFFFFFFF,F,,,F,:,F::,:,::,F:,,FFF,,,FF,,:F:FFF,:FF::F:,F::,NH:i:0   HI:i:0  AS:i:66 nM:i:0  uT:A:1  xf:i:0  ts:i:30 li:i:0  BC:Z:TGCGCGGTTTQT:Z:FFFFFFFFFF  CR:Z:CTATTCATGTGTCCCA   CY:Z:FFF:FF:FFFFFFFFF   CB:Z:CTATTCATGTGTCCCA-1 UR:Z:TTGTTGTTGAAT   UY:Z::FF:F::F,,FF   UB:Z:TTGTTGTTGAAT   RG:Z:S3_C1_Complete:0:1:HLTVVDRXY:2
ADD REPLY
0
Entering edit mode

all those reads are unmapped flag=4 , but anyway, those reads are SINGLE-END reads ( flag 1 = read paired is unchecked). So using -fq -fq2 is meaningless

ADD REPLY

Login before adding your answer.

Traffic: 2476 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