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
          Current Approaches to Protein Sequencing
          by seqadmin


          Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
          04-04-2024, 04:25 PM
        • seqadmin
          Strategies for Sequencing Challenging Samples
          by seqadmin


          Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
          03-22-2024, 06:39 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        18 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        22 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        16 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-04-2024, 09:00 AM
        0 responses
        47 views
        0 likes
        Last Post seqadmin  
        Working...
        X