Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mavadhani
    Junior Member
    • Jul 2016
    • 9

    #1

    Python script for bowtie2 alignment

    Hello All!

    I am new to coding and am trying to write a python script to analyze a bunch of fastq files from RNASeq analysis. I am using the subprocess module to call bowtie2 in order to index the genome that is in fasta format. That works just fine. But I am stuck in the next step which is using bowtie2 to align the unpaired short reads to the genome. I know I am using the correct command as it works at the terminal generating a .sam file. But my python code is not working. Here are some of the ones I have tried--

    #process = subprocess.call (['bowtie2_align', indexfiles, fastqFile1, Outputfile])
    #process = subprocess.Popen(['bowtie2_align', stdin= indexfile, fastqFile1, stdout=Outputfile])

    #process2 = subprocess.call(["bowtie2_align" (-x indexfile, -U fastqFile1, -S 'Outputfile.sam')],shell=True)

    align = 'bowtie2_align' -x cellvibrio_index -U fastqFile1 -S initial_aligns.sam'

    I would really appreciate any help/suggestions to fix this code.

    Thanks,
    -M
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    It'd be something like:

    Code:
    subprocess.call(["bowtie2", "-x", indexBaseName, "-U", fastqFile1, "S", "Outpufile.sam"])
    However, I highly encourage you to not do this and instead use something like snakemake. This lets you do things directly in python when you need to but also abstracts all of that away when you don't (like this example). Plus, you can use a cluster and in general more easily control things without reinventing the wheel for the umpteenth time.

    Comment

    • mavadhani
      Junior Member
      • Jul 2016
      • 9

      #3
      Thank you very much dpryan. I will certainly give snakemake a shot.

      -Madhavi

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        How Immunogenomics Decodes Immunity’s Genetic Blueprint
        by SEQadmin2




        The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.

        This convergence of genetics, immunology, and computation...
        Yesterday, 05:41 AM
      • SEQadmin2
        Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
        by SEQadmin2



        CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

        Despite this, “CRISPR helped turn genome editing from a specialized technique into
        ...
        07-31-2026, 11:01 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 08-24-2026, 10:32 AM
      0 responses
      42 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 08-20-2026, 11:17 AM
      0 responses
      48 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 08-18-2026, 10:05 AM
      0 responses
      55 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 08-13-2026, 12:22 PM
      0 responses
      50 views
      0 reactions
      Last Post SEQadmin2  
      Working...