Hi there,
I have a bowtie2 alignment of PE non-stranded RNA-seq reads from a bacterial species (used option -k 1; 96.20% pairs aligned concordantly exactly 1 time) , and would like to use htseq-count to get count data across genes. I am having trouble retaining reads sorted after converting a sorted bam to sam format (htseq-count needs sorted sam for PE reads).
These are my attempts and error messages:
# sorting reads
$ samtools sort myalignment.bam myalignment.sorted
# convert back to sam
$ samtools view -h myalignment.sorted.bam > out.sorted.sam
# check (truncated output) - note @HD line 'unsorted', ?
$ head out.sorted.sam
@HD VN:1.0 SO:unsorted
@SQ SN:NC_017656.1 LN:5212843
@PG ID:bowtie2 PN:bowtie2 VN:2.0.0-beta7
HWUSI-EAS1615L:13:FC64RB1AAXX:4:23:7604:14541_1 99 NC_017656.1 156 255 68M = 206 118 CAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCA IIIIIIEIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIHIIIIHGIIIIGHIIHIHH AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:68 YS:i:0 YT:Z:CP
HWUSI-EAS1615L:13:FC64RB1AAXX:4:70:9040:11393_1 99 NC_017656.1 164 255 68M = 207 111 TAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCATCACCATT IIIIFIIIIBHHHIFIIIIIIIIIHIGIHIIIIIFHIIIIBIHGHIGHIHHICIHCHF;FEDEFDEH< AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:68 YS:i:0 YT:Z:CP
# tried htseq-count (truncated output)
$ htseq-count -s no -t gene -i ID out.sorted.sam ../reference.gff
4965 GFF lines processed.
Warning: Read HWUSI-EAS1615L:13:FC64RB1AAXX:4:23:7604:14541_1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
Warning: Read HWUSI-EAS1615L:13:FC64RB1AAXX:4:70:9040:11393_1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
Warning: Read HWUSI-EAS1615L:13:FC64RB1AAXX:4:62:8731:7335_1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
Your insight is much appreciated!
I have a bowtie2 alignment of PE non-stranded RNA-seq reads from a bacterial species (used option -k 1; 96.20% pairs aligned concordantly exactly 1 time) , and would like to use htseq-count to get count data across genes. I am having trouble retaining reads sorted after converting a sorted bam to sam format (htseq-count needs sorted sam for PE reads).
These are my attempts and error messages:
# sorting reads
$ samtools sort myalignment.bam myalignment.sorted
# convert back to sam
$ samtools view -h myalignment.sorted.bam > out.sorted.sam
# check (truncated output) - note @HD line 'unsorted', ?
$ head out.sorted.sam
@HD VN:1.0 SO:unsorted
@SQ SN:NC_017656.1 LN:5212843
@PG ID:bowtie2 PN:bowtie2 VN:2.0.0-beta7
HWUSI-EAS1615L:13:FC64RB1AAXX:4:23:7604:14541_1 99 NC_017656.1 156 255 68M = 206 118 CAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCA IIIIIIEIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIHIIIIHGIIIIGHIIHIHH AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:68 YS:i:0 YT:Z:CP
HWUSI-EAS1615L:13:FC64RB1AAXX:4:70:9040:11393_1 99 NC_017656.1 164 255 68M = 207 111 TAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCATCACCATT IIIIFIIIIBHHHIFIIIIIIIIIHIGIHIIIIIFHIIIIBIHGHIGHIHHICIHCHF;FEDEFDEH< AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:68 YS:i:0 YT:Z:CP
# tried htseq-count (truncated output)
$ htseq-count -s no -t gene -i ID out.sorted.sam ../reference.gff
4965 GFF lines processed.
Warning: Read HWUSI-EAS1615L:13:FC64RB1AAXX:4:23:7604:14541_1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
Warning: Read HWUSI-EAS1615L:13:FC64RB1AAXX:4:70:9040:11393_1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
Warning: Read HWUSI-EAS1615L:13:FC64RB1AAXX:4:62:8731:7335_1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
Your insight is much appreciated!
Comment