Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
urmi-21 committed Jan 15, 2020
1 parent fa249d1 commit e908c64
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 34 deletions.
57 changes: 39 additions & 18 deletions pyrpipe/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ def perform_qc(self):

class Trimgalore(RNASeqQC):
"""This class represents trimgalore
Parameters
----------
kwargs:
trim_galore arguments.
"""
def __init__(self,**kwargs):
"""
Parameters
----------
kwargs:
trim_galore arguments. could override later too.
"""

#run super to inherit parent class properties
Expand Down Expand Up @@ -57,6 +60,7 @@ def perform_qc(self,sra_object,out_dir="",out_suffix="_trimgalore",verbose=False
Parameters
----------
sra_object: SRA
An SRA object whose fastq files will be used
out_suffix: string
Expand Down Expand Up @@ -149,6 +153,9 @@ def run_trimgalore(self,verbose=False,quiet=False,logs=True,objectid="NA",**kwar
kwargs: dict
Options to pass to trimgalore (will override existing parameters)
:return: Status of trimgalore command
:rtype: bool
"""

#override existing arguments
Expand Down Expand Up @@ -178,6 +185,7 @@ def __init__(self,**kwargs):
"""
Parameters
----------
kwargs:
bbduk.sh arguments.
"""
Expand Down Expand Up @@ -218,23 +226,30 @@ def perform_qc(self,sra_object,out_dir="",out_suffix="_bbduk",overwrite=True,ver
Parameters
----------
arg1: SRA
sra_object: SRA
an SRA object
arg2: string
out_dir: string
Path to out dir. Default: sra_object.location
out_suffix: string
Suffix for output file name
arg3: bool
overwrite: bool
overwrite existing files
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.
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.
arg3: dict
kwargs: dict
options passed to bbduk
Returns
tuple
Returns the path of fastq files after QC. tuple has one item for single end files and 2 for paired.
:return: Returns the path of fastq files after QC. tuple has one item for single end files and 2 for paired.
:rtype: tuple
"""

#make out_dir
Expand Down Expand Up @@ -308,13 +323,16 @@ def perform_cleaning(self,sra_object,bbsplit_index,out_dir="",out_suffix="_bbspl
Parameters
----------
sra_object: SRA
an SRA object
bbsplit_index: string
Path to bbsplit index or fasta file which will generate index
arg3: string
out_dir: string
Path to output dir. Default: sra_object.location
out_suffix: string
Suffix for output file name
arg4: bool
overwrite: bool
overwrite existing files
verbose: bool
Print stdout and std error
Expand All @@ -325,7 +343,7 @@ def perform_cleaning(self,sra_object,bbsplit_index,out_dir="",out_suffix="_bbspl
objectid: str
Provide an id to attach with this command e.g. the SRR accession. This is useful for debugging, benchmarking and reports.
arg5: dict
kwargs: dict
options passed to bbsplit
:return: Returns the path of fastq files after QC. tuple has one item for single end files and 2 for paired.
Expand Down Expand Up @@ -411,6 +429,9 @@ def perform_cleaning(self,sra_object,bbsplit_index,out_dir="",out_suffix="_bbspl

def run_bbsplit(self,verbose=False,quiet=False,logs=True,objectid="NA",**kwargs):
"""wrapper to run bbsplit
:return: Status of bbsplit command
:rtype: bool
"""

bbsplit_args=['ref','ref_x','build','path','in','in1','in2','outu','outu2','outu1','qin','interleaved',
Expand Down
35 changes: 27 additions & 8 deletions pyrpipe/quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def perform_quant(self,sra_object):

class Kallisto(Quant):
"""This class represents kallisto
kallisto_index: string
path to kallisto index
kwargs: dict
parametrs passed to kallisto
"""

def __init__(self,kallisto_index,**kwargs):
Expand Down Expand Up @@ -72,6 +77,7 @@ def __init__(self,kallisto_index,**kwargs):

def build_index(self,index_path,index_name,fasta,verbose=False,quiet=False,logs=True,objectid="NA",**kwargs):
"""Function to build kallisto index
index_path: str
path to the output directory
index_name: str
Expand All @@ -86,6 +92,9 @@ def build_index(self,index_path,index_name,fasta,verbose=False,quiet=False,logs=
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 kallisto. This will override the existing options in self.passed_args_dict (only replace existing arguments and not replace all the arguments).
:return: Status of kallisto index
:rtype: bool
"""

#check input
Expand Down Expand Up @@ -118,8 +127,8 @@ def build_index(self,index_path,index_name,fasta,verbose=False,quiet=False,logs=
return False

def perform_quant(self,sra_object,out_dir="",verbose=False,quiet=False,logs=True,objectid="NA",**kwargs):
"""
run kallisto quant
"""Run kallisto quant
sra_object: SRA
SRA object contatining paths to fastq files
index_path: str
Expand Down Expand Up @@ -170,8 +179,10 @@ def perform_quant(self,sra_object,out_dir="",verbose=False,quiet=False,logs=True

def run_kallisto(self,subcommand,verbose=False,quiet=False,logs=True,objectid="NA",**kwargs):
"""Wrapper for running kallisto.
Parameters
----------
subcommand: str
subcommand for kallisto
verbose: bool
Expand Down Expand Up @@ -217,6 +228,11 @@ def check_index(self):

class Salmon(Quant):
"""This class represents salmon
salmon_index: string
Path to salmon index
kwargs: dict
Options passed to salmon
"""
def __init__(self,salmon_index,**kwargs):
super().__init__()
Expand Down Expand Up @@ -276,7 +292,7 @@ def __init__(self,salmon_index,**kwargs):

def build_index(self,index_path,index_name,fasta,verbose=False,quiet=False,logs=True,objectid="NA",**kwargs):
"""
build salmon index
build salmon index and store the path to index in self
index_path: str
path to the output directory
Expand All @@ -291,7 +307,10 @@ def build_index(self,index_path,index_name,fasta,verbose=False,quiet=False,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 kallisto. This will override the existing options
Options to pass to salmon. This will override the existing options
:return: status of salmon index
:rtype: bool
"""

#check input
Expand Down Expand Up @@ -325,8 +344,7 @@ def build_index(self,index_path,index_name,fasta,verbose=False,quiet=False,logs=


def perform_quant(self,sra_object,out_dir="",libType="A",verbose=False,quiet=False,logs=True,objectid="NA",**kwargs):
"""
run salmon quant
"""run salmon quant
verbose: bool
Print stdout and std error
Expand All @@ -337,7 +355,7 @@ def perform_quant(self,sra_object,out_dir="",libType="A",verbose=False,quiet=Fal
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 kallisto. This will override the existing options
Options to pass to salmon. This will override the existing options
:return: Path to salmon out directory
:rtype: string
Expand Down Expand Up @@ -375,6 +393,7 @@ def run_salmon(self,subcommand,verbose=False,quiet=False,logs=True,objectid="NA"
Parameters
----------
subcommand: str
subcommand for salmon
verbose: bool
Expand All @@ -386,7 +405,7 @@ def run_salmon(self,subcommand,verbose=False,quiet=False,logs=True,objectid="NA"
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 kallisto. This will override the existing options
Options to pass to salmon. This will override the existing options
:return: Returns the status of salmon. True is passed, False if failed.
:rtype: bool
Expand Down
10 changes: 9 additions & 1 deletion pyrpipe/sra.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@

class SRA:
"""This class represents an SRA object
Parameters
----------
srr_accession: string
A valid SRR accession
location: String
location: string
Path where all data related to this object (e.g. .sra files, metadata, fastq files) will be stored.
Default value of the path will be "./<SRR_accession>". <SRR_accession> is added at the end of the path
so that final location is location/<SRR_accession>.
For consistency, location and SRR Accession id are not allowed to be modified.
scan_path: string
If RNA-Seq data already exists locally, provide the scan path to scan a directory and create an SRA object.
Attributes
-----------
Expand Down Expand Up @@ -150,6 +155,7 @@ def download_sra(self,verbose=False,quiet=False,logs=True,**kwargs):
Parameters
----------
kwargs: dict
dict containing additional prefetch arguments
Expand Down Expand Up @@ -254,6 +260,7 @@ def run_fasterqdump(self,delete_sra=False,verbose=False,quiet=False,logs=True,**
Parameters
----------
delete_sra: bool
delete sra file after completion
verbose: bool
Expand Down Expand Up @@ -347,6 +354,7 @@ def perform_qc(self,qcObject,deleteRawFastq=False):
Parameters
----------
qcObject: RNASeqQC object
qcObject specifying the program to be used. The object contains the necessary parametrs to execute the parameters
Expand Down

0 comments on commit e908c64

Please sign in to comment.