Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix to download function #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions getdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,21 @@ def download(url, newdir, newfile):
else:
urlstring = "wget -O " + newdir + newfile + " " + url
print urlstring
s = subprocess.Popen(urlstring, shell=True)
s.wait()
subprocess.check_call(urlstring.split(' '))

print "Finished downloading from NCBI."

# 3. Extract with fastq-dump (sratools)


def sra_extract(newdir, filename):
# if seqtype=="single":
# sra_string="fastq-dump -v "+newdir+file
# print sra_string
# elif seqtype=="paired":
# check whether .fastq exists in directory
if glob.glob(newdir + "*.fastq"):
print "SRA has already been extracted", filename
else:
sra_string = "fastq-dump -v -O " + newdir + " --split-3 " + newdir + filename
print sra_string
print "extracting SRA..."
s = subprocess.Popen(sra_string, shell=True, stdout=PIPE)
s.wait()
subprocess.check_call(sra_string.split(' '), stdout=PIPE)
print "Finished SRA extraction."

# 4. Generate fastqc from all fastq in directory
Expand Down