Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kga1978
    Senior Member
    • Nov 2010
    • 100

    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.
  • maubp
    Peter (Biopython etc)
    • Jul 2009
    • 1544

    #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

    • kga1978
      Senior Member
      • Nov 2010
      • 100

      #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

      • SEQadmin2
        Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
        by SEQadmin2


        Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

        The systematic characterization of the human proteome has
        ...
        07-20-2026, 11:48 AM
      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM
      • SEQadmin2
        Cancer Drug Resistance: The Lingering Barrier to Rising Survival
        by SEQadmin2



        Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

        There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
        07-08-2026, 05:17 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 07-24-2026, 12:17 PM
      0 responses
      16 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-23-2026, 11:41 AM
      0 responses
      18 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-20-2026, 11:10 AM
      0 responses
      24 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-13-2026, 10:26 AM
      0 responses
      37 views
      0 reactions
      Last Post SEQadmin2  
      Working...