-
-
Save alienzj/8bb3521da2a8d2863b066718e2c3a995 to your computer and use it in GitHub Desktop.
Revisions
-
slowkow revised this gist
Apr 24, 2015 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,8 +19,13 @@ sra_paired() { [[ $x == 2 ]] } if [[ "$1" == "" ]]; then echo "usage: sra-paired.sh file.sra" exit 1 fi if sra_paired "$1"; then echo "$1 contains paired-end sequencing data" else echo "$1 does not contain paired-end sequencing data" fi -
slowkow created this gist
Apr 24, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ #!/usr/bin/env bash # sra-paired.sh # Kamil Slowikowski # April 23, 2014 # # Check if an SRA file contains paired-end sequencing data. # # See documentation for the SRA Toolkit: # http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=toolkit_doc&f=fastq-dump sra_paired() { local SRA="$1" local x=$( fastq-dump -I -X 1 -Z --split-spot "$SRA" 2>/dev/null \ | awk '{if(NR % 2 == 1) print substr($1,length($1),1)}' \ | uniq \ | wc -l ) [[ $x == 2 ]] } if sra_paired $1; then echo "$1 contains paired-end sequencing data" else echo "$1 does not contain paired-end sequencing data" fi