Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Olha
    Junior Member
    • Sep 2015
    • 6

    #1

    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
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #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

    • Olha
      Junior Member
      • Sep 2015
      • 6

      #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

      • Olha
        Junior Member
        • Sep 2015
        • 6

        #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

        • SEQadmin2
          16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
          by SEQadmin2




          NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
          Yesterday, 06:46 AM
        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 10-28-2026, 09:57 AM
        0 responses
        29 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-28-2026, 09:51 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 11:13 AM
        0 responses
        71 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        48 views
        0 reactions
        Last Post SEQadmin2  
        Working...