-
-
Save skurscheid/6d97ccbc77e6462f74a9ff5ff2bf33eb to your computer and use it in GitHub Desktop.
Function to determine if an SRA file has paired or single-ended reads
This file contains 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 characters
def isPairedSRA(filename): | |
filename = os.path.abspath(filename); | |
try: | |
contents = sp.check_output(["fastq-dump","-X","1","-Z","--split-spot", filename]); | |
except sp.CalledProcessError, e: | |
raise Exception("Error running fastq-dump on",filename); | |
if(contents.count("\n") == 4): | |
return False; | |
elif(contents.count("\n") == 8): | |
return True: | |
else: | |
raise Exception("Unexpected output from fast-dump on ", filename); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment