Header Leaderboard Ad


Shell Scripting help ***



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

  • #16
    sorry i mean
    fastq-dump -Z $1 | bowtie -v 3 -k 2 --sam $2 -|samtools faidx $2 -| samtools view -u -t -$3


    • #17
      No it is not working for me . It is saying fail to build fasta index . it is coming like this

      [email protected]:/raid/development/anusha/python_test/shelltest> ./SRAtoBAM.copy.sh /raid/development/anusha/python_test/shelltest/SRR203400.sra /raid/references-and-indexes/hg19/bowtie-indexes/hg19 /raid/development/anusha/python_test/shelltest/SRR203400.bam
      view: invalid option -- '/'

      Usage: samtools view [options] <in.bam>|<in.sam> [region1 [...]]

      Options: -b output BAM
      -h print header for the SAM output
      -H print header only (no alignments)
      -S input is SAM
      -u uncompressed BAM output (force -b)
      -1 fast compression (force -b)
      -x output FLAG in HEX (samtools-C specific)
      -X output FLAG in string (samtools-C specific)
      -c print only the count of matching records
      -L FILE output alignments overlapping the input BED FILE [null]
      -t FILE list of reference names and lengths (force -S) [null]
      -T FILE reference sequence file (force -S) [null]
      -o FILE output file name [stdout]
      -R FILE list of read groups to be outputted [null]
      -f INT required flag, 0 for unset [0]
      -F INT filtering flag, 0 for unset [0]
      -q INT minimum mapping quality [0]
      -l STR only output reads in library STR [null]
      -r STR only output reads in read group STR [null]
      -s FLOAT fraction of templates to subsample; integer part as seed [-1]
      -? longer help


      1. By default, this command assumes the file on the command line is in
      the BAM format and it prints the alignments in SAM. If `-t' is
      applied, the input file is assumed to be in the SAM format. The
      file supplied with `-t' is SPACE/TAB delimited with the first two
      fields of each line consisting of the reference name and the
      corresponding sequence length. The `.fai' file generated by `faidx'
      can be used here. This file may be empty if reads are unaligned.

      2. SAM->BAM conversion: `samtools view -bT ref.fa in.sam.gz'.

      3. BAM->SAM conversion: `samtools view in.bam'.

      4. A region should be presented in one of the following formats:
      `chr1', `chr2:1,000' and `chr3:1000-2,000'. When a region is
      specified, the input alignment file must be an indexed BAM file.

      5. Option `-u' is preferred over `-b' when the output is piped to
      another samtools command.


      • #18
        Originally posted by AnushaC View Post
        sorry i mean
        fastq-dump -Z $1 | bowtie -v 3 -k 2 --sam $2 -|samtools faidx $2 -| samtools view -u -t -$3
        -t is used if you have a SAM file without a header, which isn't the case here. Also -u is mostly useful if you're then piping the output of samtools to something else that expects BAM as input. What you want is something like:

        fastq-dump -Z $1 | bowtie -v 3 -k 2 --sam $2 - | samtools view -bS -o $3 -


        • #19
          Forget the shell script for a moment. Can you get these commands to work by just typing them one at a time into the command line? You need to figure that out first, before you go stringing commands you don't understand into each other.


          • #20
            Hi swbarness ,
            these commands all working meaning my fastq dump ,bow tie and samtools view all i checked on command line . now i have a pipeline for converting single sam to bam file . Now i have 8 of those kind of file each in different subdirectory and in a directory now i want to iterate over each sam file . Hope u understood what i am saying .



            Latest Articles


            • seqadmin
              Targeted Sequencing: Choosing Between Hybridization Capture and Amplicon Sequencing
              by seqadmin

              Targeted sequencing is an effective way to sequence and analyze specific genomic regions of interest. This method enables researchers to focus their efforts on their desired targets, as opposed to other methods like whole genome sequencing that involve the sequencing of total DNA. Utilizing targeted sequencing is an attractive option for many researchers because it is often faster, more cost-effective, and only generates applicable data. While there are many approaches...
              03-10-2023, 05:31 AM
            • seqadmin
              Expert Advice on Automating Your Library Preparations
              by seqadmin

              Using automation to prepare sequencing libraries isn’t a new concept, and most researchers are aware that there are numerous benefits to automating this process. However, many labs are still hesitant to switch to automation and often believe that it’s not suitable for their lab. To combat these concerns, we’ll cover some of the key advantages, review the most important considerations, and get real-world advice from automation experts to remove any lingering anxieties....
              02-21-2023, 02:14 PM





            Topics Statistics Last Post
            Started by seqadmin, 03-17-2023, 12:32 PM
            0 responses
            Last Post seqadmin  
            Started by seqadmin, 03-15-2023, 12:42 PM
            0 responses
            Last Post seqadmin  
            Started by seqadmin, 03-09-2023, 10:17 AM
            0 responses
            1 like
            Last Post seqadmin  
            Started by seqadmin, 03-03-2023, 12:03 PM
            0 responses
            Last Post seqadmin