Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTSeq_output_Error_occured_when_processing_SAM_input

    Dear, SEQanswers community,

    I faced issue with creation counting tables for RNA-seq data using HTSeq software.
    Before I performed TopHat alignment (accepted_hints.bam) for 28 fastq files (single-end reads) and Cuffmerge assemble (merged.gtf).

    This is script, that I used:
    htseq-count --format bam --stranded no accepted_hits.bam /merged.gtf > htseq_out.txt

    At the end of HTSeq output file I got a message:

    33300000 SAM alignment records processed.
    Error occured when processing SAM input (record #33301227 in file /media/olha/3CEBA24E475DF793/ALL_olha_2/A15/tophat_out/accepted_hits.bam):
    reference_id -1 out of range 0<=tid<84
    [Exception type: ValueError, raised in calignmentfile.pyx:642]

    Any suggestions will be highly appreciated.

    Olha

  • #2
    A "reference_id -1" should only occur if a read is unmapped. My guess is that you somehow have an unmapped read without the unmapped bit in the flag being set. What's the output of:
    Code:
    samtools view -F 4 /media/olha/3CEBA24E475DF793/ALL_olha_2/A15/tophat_out/accepted_hits.bam | awk '{if($3=="*") print $0}'
    That should produce nothing, though I suspect it'll print the problematic line in the BAM file.

    Comment


    • #3
      Dear, Devon,

      Thank you for reply.
      I run your script and get this output:

      Code:
      HWI-ST538:357:D2BKUACXX:1:1105:13318:13823	16	*	1204092	50	7M600N25M	*	0	0	CGCACGGACGCCCCCAAAACGCATATGACTCG	HE=AJJJJJJJJIGIJIGHHHHHHFFFFF@CB	AS:i:0	XM:i:2	XO:i:0	XG:i:0	MD:Z:17G13A0	NM:i:2	XS:A:+	NH:i:1
      HWI-ST538:357:D2BKUACXX:1:1107:19710:10717	0	*	3860981	50	2M516N22M	*	0	0	CCGCCACTCCACGATGATGGGGTT	<?@DDFFDFFAFHHII?FHGGHIG	AS:i:0	XM:i:2	XO:i:0	XG:i:0	MD:Z:13G8C1	NM:i:2	XS:A:-	NH:i:1
      HWI-ST538:357:D2BKUACXX:1:2314:13745:61117	0	*	4385042	50	12M1572N11M	*	0	0	TGGGGTGGGGTCCTGGCTTTGTG	CCCFFBDFHHHHHJJJJJJJJHI	AS:i:0	XM:i:2	XO:i:0	XG:i:0	MD:Z:18C2G1	NM:i:2	XS:A:-	NH:i:1
      How can I extract these reads from my accepted_hints.bam file?

      Thank You!

      Comment


      • #4
        Also I tried this script for removing aforemention reads. I put them all into txt file (read_ids_to_remove.txt).

        Code:
        samtools view -h accepted_hits.bam [grep -vf read_ids_to_remove.txt] samtools view -bS -o accepted_hits_filter.bam
        But I got error message:

        Code:
        view: invalid option -- 'v'
        [samopen] no @SQ lines in the header.
        [main_samview] random alignment retrieval only works for indexed BAM files.
        Does it means, that I need to sorted and indexing accepted_hits.bam file before removing unmapped reads?

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Recent Advances in Sequencing Analysis Tools
          by seqadmin


          The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
          Yesterday, 07:48 AM
        • seqadmin
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Yesterday, 07:17 AM
        0 responses
        11 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-02-2024, 08:06 AM
        0 responses
        19 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-30-2024, 12:17 PM
        0 responses
        20 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-29-2024, 10:49 AM
        0 responses
        29 views
        0 likes
        Last Post seqadmin  
        Working...
        X