Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
urmi-21 committed Jan 10, 2021
1 parent 248b6cf commit 0126095
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pyrpipe/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def __init__(self,*args,index=None,genome=None,threads=None,**kwargs):
self.resolve_parameter("--genomeDir",index,index,'index')

#check index
if not pu.check_starindex(self.index):
if not self.check_index():
if not (pu.check_files_exist(self.genome)):
pu.print_boldred("STAR index '{}' not found; New index could not be created as genome file '{}' not found.".format(self.index,self.genome))
raise ValueError("Please provide a valid STAR index, or a valid fasta file to generate the index")
Expand Down Expand Up @@ -488,13 +488,13 @@ def __init__(self,*args,index=None,genome=None,threads=None,**kwargs):
self.resolve_parameter("-x",index,index,'index')

#if index is passed, update the passed arguments
if not pu.check_bowtie2index(index):
if not self.check_index():
if not (pu.check_files_exist(self.genome)):
pu.print_boldred("Bowtie2 index '{}' not found; New index could not be created as genome file '{}' not found.".format(self.index,self.genome))
raise ValueError("Please provide a valid Bowtie2 index, or a valid fasta file to generate the index")
else:
#call build index to generate index
self.build_index(index,self.genome)
self.build_index(self.index,self.genome)


def build_index(self,index_path,genome,objectid="NA"):
Expand Down
2 changes: 1 addition & 1 deletion pyrpipe/pyrpipe_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def check_hisatindex(index):
return True

def check_kallistoindex(index):
"""Function to check if salmon index is valid and exists.
"""Function to check if kallisto index is valid and exists.
Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions pyrpipe/quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self,*args,index=None,transcriptome=None,threads=None,**kwargs):

#check index
#kallisto index is a single file
if not pu.check_files_exist(index):
if not self.check_index():
if not (pu.check_files_exist(self.transcriptome)):
pu.print_boldred("Kallisto index '{}' not found; New index could not be created as transcriptome file '{}' not found.".format(self.index,self.transcriptome))
raise ValueError("Please provide a valid Kallisto index, or a valid fasta file to generate the index")
Expand Down Expand Up @@ -244,7 +244,7 @@ def __init__(self,*args,index=None,transcriptome=None,threads=None,**kwargs):
self.resolve_parameter("-i",index,index,'index')

#check index
if not pu.check_salmonindex(index):
if not self.check_index():
if not (pu.check_files_exist(self.transcriptome)):
pu.print_boldred("Salmon index '{}' not found; New index could not be created as transcriptome file '{}' not found.".format(self.index,self.transcriptome))
raise ValueError("Please provide a valid Salmon index, or a valid fasta file to generate the index")
Expand Down

0 comments on commit 0126095

Please sign in to comment.