Skip to content

Commit

Permalink
Merge pull request #2 from lijing28101/master
Browse files Browse the repository at this point in the history
format docstrings
  • Loading branch information
urmi-21 committed Jan 15, 2020
2 parents 51a75ef + b2feabd commit 027aa3c
Show file tree
Hide file tree
Showing 9 changed files with 612 additions and 466 deletions.
190 changes: 106 additions & 84 deletions pyrpipe/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,26 @@ def perform_assembly(self,bam_file,out_dir="",out_suffix="_stringtie",overwrite=
Parameters
----------
bam_file (string): path to the bam file
out_suffix (string): Suffix for the output gtf file
overwrite (bool): Overwrite if output file already exists.
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession. This is useful for debugging, benchmarking and reports.
kwargs (dict): Options to pass to stringtie. This will override the existing options
in self.passed_args_dict (only replace existing arguments and not replace all the arguments).
bam_file: string
path to the bam file
out_suffix: string
Suffix for the output gtf file
overwrite: bool
Overwrite if output file already exists.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession. This is useful for debugging, benchmarking and reports.
kwargs: dict
Options to pass to stringtie. This will override the existing options in self.passed_args_dict (only replace existing arguments and not replace all the arguments).
Returns
-------
string: path to output GTF file
:return: Returns the path to output GTF file
:rtype: string
"""

#create path to output file
Expand Down Expand Up @@ -113,21 +120,27 @@ def stringtie_merge(self,*args,out_suffix="_stringtieMerge",overwrite=True,verbo
"""Function to run stringtie merge.
Parameters
----------
args (tuple): path to gtf files to merge
out_suffix (string): Suffix for output gtf file name
args: tuple
path to gtf files to merge
out_suffix: string
Suffix for output gtf file name
arg2: tuple
input Gtf files
overwrite (bool): Overwrite if output file already exists.
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession. This is useful for debugging, benchmarking and reports.
kwargs (dict): Options to pass to stringtie. This will override the existing options
in self.passed_args_dict (only replace existing arguments and not replace all the arguments).
Returns
-------
string: path to the merged GTF file
overwrite: bool
Overwrite if output file already exists.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession. This is useful for debugging, benchmarking and reports.
kwargs: dict
Options to pass to stringtie. This will override the existing options in self.passed_args_dict (only replace existing arguments and not replace all the arguments).
:return: Returns the path to the merged GTF file
:rtype: string
"""

if len(args) < 1:
Expand Down Expand Up @@ -169,16 +182,19 @@ def run_stringtie(self,verbose=False,quiet=False,logs=True,objectid="NA",**kwarg
Parameters
----------
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession. This is useful for debugging, benchmarking and reports.
kwargs (dict): Options to pass to stringtie. This will override the existing options
in self.passed_args_dict (only replace existing arguments and not replace all the arguments).
Returns
-------
bool: status of stringtie command.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession. This is useful for debugging, benchmarking and reports.
kwargs: dict
Options to pass to stringtie. This will override the existing options in self.passed_args_dict (only replace existing arguments and not replace all the arguments).
:return: Returns the status of stringtie command.
:rtype: bool
"""

#override existing arguments
Expand Down Expand Up @@ -252,18 +268,19 @@ def perform_assembly(self,bam_file,out_dir="",out_suffix="_cufflinks",overwrite=
Suffix for the output gtf file
overwrite: bool
Overwrite if output file already exists.
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession.
kwargs: dict
Options to pass to cufflinks. This will override the existing options self.passed_args_dict (only replace existing arguments and not replace all the arguments).
Returns
-------
string
path to output GTF file
:return: Returns the path to output GTF file
:rtype: string
"""

#create path to output file
Expand Down Expand Up @@ -307,16 +324,17 @@ def run_cuff(self,command,verbose=False,quiet=False,logs=True,objectid="NA",**kw
----------
command: string
the command name
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession.
Returns
-------
bool
return status of the command.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession.
:return: Returns the status of the command.
:rtype: bool
"""
validCommands=['cuffcompare','cuffdiff', 'cufflinks', 'cuffmerge', 'cuffnorm', 'cuffquant']
if command in validCommands:
Expand All @@ -343,18 +361,19 @@ def run_cufflinks(self,verbose=False,quiet=False,logs=True,objectid="NA",**kwarg
Parameters
----------
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession.
kwargs: dict
Options passed to cufflinks
Returns
-------
bool
status of cufflinks command.
:return: Returns the status of cufflinks command.
:rtype: bool
"""

#override existing arguments
Expand Down Expand Up @@ -419,19 +438,20 @@ def perform_assembly(self,sra_object=None,bam_file=None,out_dir="trinity_out_dir
specify the "--genome_guided_max_intron" argument
overwrite: bool
Overwrite if output file already exists
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession.
kwargs: dict
Options to pass to stringtie. This will override the existing options self.passed_args_dict (only replace existing arguments and not replace all the arguments).
Returns
-------
string
path to output GTF file
:return: Return the path to output GTF file
:rtype: string
"""

#add trinity to outdir
Expand Down Expand Up @@ -476,17 +496,19 @@ def run_trinity(self,verbose=False,quiet=False,logs=True,objectid="NA",**kwargs)
Parameters
----------
verbose (bool): Print stdout and std error
quiet (bool): Print nothing
logs (bool): Log this command to pyrpipe logs
objectid (str): Provide an id to attach with this command e.g. the SRR accession.
verbose: bool
Print stdout and std error
quiet: bool
Print nothing
logs: bool
Log this command to pyrpipe logs
objectid: str
Provide an id to attach with this command e.g. the SRR accession.
kwargs: dict
Options passed to trinity
Returns
-------
bool
status of trinity command.
:return: Return the status of trinity command.
:rtype: bool
"""

#override existing arguments
Expand All @@ -506,4 +528,4 @@ def run_trinity(self,verbose=False,quiet=False,logs=True,objectid="NA",**kwargs)





9 changes: 6 additions & 3 deletions pyrpipe/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ class Benchmark:
"""Class to generate benchmark reports from pyrpipe logs.
Parameters
----------
log_file (string): path to the log file
env_log (string): path to the ENV log file
out_dir (string): path to the output directory
log_file: string
path to the log file
env_log: string
path to the ENV log file
out_dir: string
path to the output directory
"""
Expand Down

0 comments on commit 027aa3c

Please sign in to comment.