Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • AnushaC
    Member
    • Sep 2013
    • 78

    #16
    Hi All,
    anusha@cn1:/raid/development/anusha/python_test/shelltest> cat SRAtoBAM_BN_cp1.sh
    #bin/bash
    #basename /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203400/SRR203400.sra
    find $1
    basename $1anusha@cn1:/raid/development/anusha/python_test/shelltest> ./SRAtoBAM_BN_cp1.sh /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203400
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203400/SRR203400.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203401
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203401/SRR203401.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203402
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203402/SRR203402.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203403
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203403/SRR203403.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203404
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203404/SRR203404.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203405
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203405/SRR203405.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203406
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203406/SRR203406.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203407
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203407/SRR203407.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203408
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203408/SRR203408.sra
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203409
    /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/SRR203409/SRR203409.sra
    SRX062364
    I am trying to pipe so that i will get sra name find $1 - | basename $1

    Thanks in advance,
    Anusha.Ch

    Comment

    • AnushaC
      Member
      • Sep 2013
      • 78

      #17
      HI aLL,
      #find $1
      #basename $1
      #find $1 -type f -print0 | xargs -0 -n1 basename
      find -L $1 -type f -print0 | xargs -n1 basename
      I was using like this . i am getting like this
      xargs: WARNING: a NUL character occurred in the input. It cannot be passed through in the argument list. Did you mean to use the --null option?
      SRR203400.sra
      more over how can get all the sra files without hardcoding anything

      Thanks in advance,
      Anusha.Ch

      Comment

      • rhinoceros
        Senior Member
        • Apr 2013
        • 372

        #18
        How about you post your code so that you have commented each line separately (what you think it does) so that we might get some idea of what you're trying to do?
        savetherhino.org

        Comment

        • AnushaC
          Member
          • Sep 2013
          • 78

          #19
          Hi All,
          Here is my problem -- I wrote two shell scripts one for getting all the sra files in given directory ,one for converting from sam file to bam file . Both are working fine but I am getting confused how to pipe my all sra input second program which converts to bam file

          This is my first program
          #bin/bash
          #finding the given sra files in directories and subdirectories and outputing them
          find -L $1 -type f -print0 | xargs --null -n1 basename

          give me output like this

          anusha@cn1:/raid/development/anusha/python_test/shelltest> ./SRAtoBAM_BN_cp1.sh /raid/databases/ROADMAP/DGF/ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX062/SRX062364/
          SRR203400.sra
          SRR203401.sra
          SRR203402.sra
          SRR203403.sra
          SRR203404.sra
          SRR203405.sra
          SRR203406.sra
          SRR203407.sra
          SRR203408.sra
          SRR203409.sra
          now i want to all my sra file and pipe this program

          #!/bin/bash
          # Taking an SRA input and hg19 reference into variables
          sraip=$1
          hg19ref=$2
          # generating shell pipeline
          # 1) using fastq dump to generate fastq file given sra input
          #2) using bowtie to map the fastq file to given reference genome
          #3) using samtools view to generate bam file from the given sam file
          fastq-dump -Z $1 | bowtie -v 3 -k 2 --sam $2 - | samtools view -bS -o $3 -

          which converts from sra to bam format

          Thanks very much in advance,
          Anusha.Ch

          Comment

          • rhinoceros
            Senior Member
            • Apr 2013
            • 372

            #20
            Your first script returns a list of filenames, how could your second script know where these files are? One solution would be to make your first script write the full paths of your files to some file and then in the second script you go through that file line by line. Something like:

            Code:
            while read line
            do 
            something with a $line
            done <yourInputListOfFilePaths.txt
            Last edited by rhinoceros; 10-12-2013, 02:34 AM.
            savetherhino.org

            Comment

            • AnushaC
              Member
              • Sep 2013
              • 78

              #21
              Hi got it ,
              Thanks

              Anusha.Ch

              Comment

              Latest Articles

              Collapse

              • GATTACAT
                Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                by GATTACAT
                Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                07-01-2026, 11:43 AM
              • SEQadmin2
                Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                by SEQadmin2


                I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                Here are nine questions we think about, in roughly the order they matter, before...
                06-18-2026, 07:11 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 07-02-2026, 11:08 AM
              0 responses
              12 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-30-2026, 05:37 AM
              0 responses
              14 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-26-2026, 11:10 AM
              0 responses
              20 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-17-2026, 06:09 AM
              0 responses
              54 views
              0 reactions
              Last Post SEQadmin2  
              Working...