Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
urmi-21 committed Jan 10, 2021
1 parent 0126095 commit d92cd8e
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions pyrpipe/sra.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,21 @@ def init_object(self,srr_accession,directory,fastq,fastq2,sra):

#if fastq are provided
if fastq and fastq2:
if pu.check_files_exist(fastq,fastq2):
self.layout="PAIRED"
#set dir
self.directory=pu.get_file_directory(fastq)
return True
else:
self.layout="PAIRED"
self.directory=pu.get_file_directory(fastq)
if not pu.check_files_exist(fastq,fastq2) and not _dryrun:
pu.print_boldred("ERROR: File not found")
raise ValueError("Please check fastq files {} {}".format(fastq,fastq2))
return True

#if only one fastq (single)
if fastq:
if pu.check_files_exist(fastq):
self.layout="SINGLE"
self.directory=pu.get_file_directory(fastq)
return True
else:
self.layout="SINGLE"
self.directory=pu.get_file_directory(fastq)
if not pu.check_files_exist(fastq) and not _dryrun:
pu.print_boldred("ERROR: File not found")
raise ValueError("Please check fastq files {}".format(fastq))
return False
return True

#init from srr_accession and directory
return self.init_from_accession(srr_accession,directory)
Expand Down

0 comments on commit d92cd8e

Please sign in to comment.