Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Getting reads from lastal results?

    Hi All,

    I have a bunch of paired-end reads and I aligned them against a custom database (viruses) using LASTAL:

    Code:
    lastal -Q1 /idi/sabetilab/kandersen/references/blast/arena G771_2.reads1.sub.fastq | maf-sort.sh -n2 > G771_2.reads1.sub.maf
    lastal -Q1 /idi/sabetilab/kandersen/references/blast/arena G771_2.reads2.sub.fastq | maf-sort.sh -n2 > G771_2.reads2.sub.maf
    I then used the "last-pair-probs" script to create a single maf file containing the entries:

    Code:
    last-pair-probs.py G771_2.reads1.sub.maf G771_2.reads2.sub.maf > G771_2.sub.maf
    Followed by conversion into SAM format (to get the reads):

    Code:
    maf-convert.py sam G771_2.sub.maf > G771_2.sub.sam
    So far, so good, except I think the SAM file doesn't correctly assign the two mates. Here's what the resultant SAM file looks like:

    Code:
    @HD	VN:1.3	SO:unknown
    D0N2CACXX120229:2:1101:21311:18913/1	0	LASV-G771-S-Sierra_Leone-2010H	14	24	101M	*	0	0	CCTAGGCATTTTTGGTTGCGCAATTCAAGTGT
    CCTATTTAAAATGGGACAGATAGTGACATTCTTCCAGGAAGTGCCTCATGTAATAGAAGAGGTGATGAA	@@@FFFDEHHHHFEGIJGBFHIIGG>DD>GIGGIDDFEEF@>DG>DC3BF;=<@FC@F@FGGC;D@=>AEA;?)7?.;@3>CE;>>;(
    353559@A#####	NM:i:0	AS:i:584
    D0N2CACXX120229:2:1101:21311:18913/2	16	LASV-G771-S-Sierra_Leone-2010H	646	24	101M	*	0	0	TGGTATTTACATTGCTCTTGACTCAGGCCGTG
    ACCGGTGGGACTGTATTATGACTAGTTATCAATATCTGATAATCCAAAATACGACCTGGGAAGATCACT	################@;@>5==A?DFEECA/@E@BF@=B0?4B4DFDB<??>HCFB<<D<>G?9D?ED?GFEE@GEFJIEEGGBAHF
    As you can see, the two mates are in there, but when I run picard to convert to FASTQ format (required for downstream analyses), then I only get the first mate ("G771_2.sub.sam.reads1.fastq " containing all /1 and /2 reads), but not the second ("G771_2.sub.sam.reads.reads2.fastq" - this file is empty):

    Code:
    SamToFastq.jar INPUT=G771_2.sub.sam FASTQ=G771_2.sub.sam.reads1.fastq SECOND_END_FASTQ=G771_2.sub.sam.reads.reads2.fastq VALIDATION_STRINGENCY=SILENT
    Code:
    @D0N2CACXX120229:2:1101:21311:18913/1
    CCTAGGCATTTTTGGTTGCGCAATTCAAGTGTCCTATTTAAAATGGGACAGATAGTGACATTCTTCCAGGAAGTGCCTCATGTAATAGAAGAGGTGATGAA
    +
    @@@FFFDEHHHHFEGIJGBFHIIGG>DD>GIGGIDDFEEF@>DG>DC3BF;=<@FC@F@FGGC;D@=>AEA;?)7?.;@3>CE;>>;(353559@A#####
    @D0N2CACXX120229:2:1101:21311:18913/2
    AGTGATCTTCCCAGGTCGTATTTTGGATTATCAGATATTGATAACTAGTCATAATACAGTCCCACCGGTCACGGCCTGAGTCAAGAGCAATGTAAATACCA
    +
    @?@DDDDDHDCDFFHABGGEEIJFEG@EEFG?DE?D9?G><D<<BFCH>??<BDFD4B4?0B=@FB@E@/ACEEFD?A==5>@;@################
    Any thoughts on how to resolve this? In other word, how to take a bunch of paired-end reads, align them against a database using LASTAL followed by extraction of the aligned (or for other purposes - unaligned) reads in the correct mate pairs?

    Thanks very much in advance.

  • #2
    Originally posted by kga1978 View Post
    ...
    So far, so good, except I think the SAM file doesn't correctly assign the two mates. Here's what the resultant SAM file looks like:

    Code:
    @HD	VN:1.3	SO:unknown
    D0N2CACXX120229:2:1101:21311:18913/1	0	LASV-G771-S-Sierra_Leone-2010H	14	24	101M	*	0	0	CCTAGGCATTTTTGGTTGCGCAATTCAAGTGT
    CCTATTTAAAATGGGACAGATAGTGACATTCTTCCAGGAAGTGCCTCATGTAATAGAAGAGGTGATGAA	@@@FFFDEHHHHFEGIJGBFHIIGG>DD>GIGGIDDFEEF@>DG>DC3BF;=<@FC@F@FGGC;D@=>AEA;?)7?.;@3>CE;>>;(
    353559@A#####	NM:i:0	AS:i:584
    D0N2CACXX120229:2:1101:21311:18913/2	16	LASV-G771-S-Sierra_Leone-2010H	646	24	101M	*	0	0	TGGTATTTACATTGCTCTTGACTCAGGCCGTG
    ACCGGTGGGACTGTATTATGACTAGTTATCAATATCTGATAATCCAAAATACGACCTGGGAAGATCACT	################@;@>5==A?DFEECA/@E@BF@=B0?4B4DFDB<??>HCFB<<D<>G?9D?ED?GFEE@GEFJIEEGGBAHF
    Yes, that is not a proper SAM file if they are meant to be paired reads. The QNAME (column 1) should be just D0N2CACXX120229:2:1101:21311:18913 for these entries, and the first/second part encoded in the FLAG (column 2).

    Something like this:

    Code:
    @HD	VN:1.3	SO:unknown
    D0N2CACXX120229:2:1101:21311:18913	99	LASV-G771-S-Sierra_Leone-2010H	14	24	101M	*	0	0	CCTAGGCATTTTTGGTTGCGCAATTCAAGTGT
    CCTATTTAAAATGGGACAGATAGTGACATTCTTCCAGGAAGTGCCTCATGTAATAGAAGAGGTGATGAA	@@@FFFDEHHHHFEGIJGBFHIIGG>DD>GIGGIDDFEEF@>DG>DC3BF;=<@FC@F@FGGC;D@=>AEA;?)7?.;@3>CE;>>;(
    353559@A#####	NM:i:0	AS:i:584
    D0N2CACXX120229:2:1101:21311:18913	147	LASV-G771-S-Sierra_Leone-2010H	646	24	101M	*	0	0	TGGTATTTACATTGCTCTTGACTCAGGCCGTG
    ACCGGTGGGACTGTATTATGACTAGTTATCAATATCTGATAATCCAAAATACGACCTGGGAAGATCACT	################@;@>5==A?DFEECA/@E@BF@=B0?4B4DFDB<??>HCFB<<D<>G?9D?ED?GFEE@GEFJIEEGGBAHF
    This is how I calculated the FLAG values (in Python), assuming they are properly paired and only the second is mapped on the reverse strand:

    Code:
    >>> 0x1 + 0x2 + 0x40 + 0x20
    99
    >>> 0x1 + 0x2 + 0x80 + 0x10
    147

    Comment


    • #3
      I suspected it would be something like this - crumbs. I'll see if I can get around the problem some other way. Thanks maubp

      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...
        05-06-2024, 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, 02:46 PM
      0 responses
      11 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-07-2024, 06:57 AM
      0 responses
      13 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-06-2024, 07:17 AM
      0 responses
      17 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-02-2024, 08:06 AM
      0 responses
      23 views
      0 likes
      Last Post seqadmin  
      Working...
      X