Skip to content

Commit

Permalink
update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
maxibor committed Apr 27, 2020
1 parent 64b8b38 commit 9a734d3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pydamage/damage.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def get_damage(self, wlen, show_al):
wlen (int): window length
show_al(bool): print alignments representations
Returns:
all_ct(list): positions of reads with CtoT transitions
all_ga(list): positions of reads with GtoA transitions
list: all_ct - positions of reads with CtoT transitions
list: all_ga - positions of reads with GtoA transitions
"""

all_ct = []
Expand Down
2 changes: 1 addition & 1 deletion pydamage/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def analyze(bam, wlen=30, show_al=False, mini=2000, cov=0.5, process=1, outdir="
verbose(bool): verbose mode
force(bool): force overwriting of results directory
Returns:
df(pd.DataFrame): pandas DataFrame containg pydamage results
pd.DataFrame: pandas DataFrame containg pydamage results
"""
if verbose:
Expand Down
8 changes: 4 additions & 4 deletions pydamage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def pmf(self, x, geom_p, geom_pmin, geom_pmax):
geom_pmin (float): min y value
geom_pmax (float): max y value
Returns:
(numpy array): PMF(x)
np.array: PMF(x)
"""
base_geom = ((1-geom_p)**x)*geom_p
xmin = min(base_geom)
Expand All @@ -49,7 +49,7 @@ def log_pmf(self, x, geom_p, geom_pmin, geom_pmax):
geom_pmin (float): min y value
geom_pmax (float): max y value
Returns:
(numpy array): LogPMF(x)
np.array: LogPMF(x)
"""
return(np.log(self.pmf(x=x, geom_p=geom_p, geom_pmin=geom_pmin, geom_pmax=geom_pmax)))

Expand All @@ -76,7 +76,7 @@ def pmf(self, x, unif_pmin):
x (numpy array) data
unif_pmin (float): target y value
Returns:
(numpy array): PMF(x)
np.array: PMF(x)
"""
return(np.array([unif_pmin]*len(x)))

Expand All @@ -87,6 +87,6 @@ def log_pmf(self, x, unif_pmin):
x (numpy array) data
geom_pmin (float): target y value
Returns:
(numpy array): LogPMF(x)
np.array: LogPMF(x)
"""
return(np.log(self.pmf(x=x, unif_pmin=unif_pmin)))
4 changes: 2 additions & 2 deletions pydamage/optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def optim(function, parameters, xdata, ydata, bounds, loss='huber'):
((par1_min, par2_min), (par1_max, par2_max))
loss (str): loss function. See https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.least_squares.html#scipy.optimize.least_squares
Returns:
popt_dict (dict): 'parameter_name':'parameter_value'
perr_dict (dict): 'parameter_name':'standard_deviation'
dict: popt_dict - 'parameter_name':'parameter_value'
dict: perr_dict - 'parameter_name':'standard_deviation'
"""
popt, pcov = curve_fit(function, xdata=xdata, ydata=ydata, bounds=bounds, loss=loss)
Expand Down
3 changes: 1 addition & 2 deletions pydamage/parse_damage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def damage_al(reference, query, cigartuple, wlen, show_al):
wlen (int): window length
print_al (bool): print alignment
Returns:
CT (list): list of CtoT positions
GA (list): list of GtoA positions
dict : {'CT': list of CtoT positions, 'GA': list of GtoA positions}
"""
r_pos = 0
q_pos = 0
Expand Down

0 comments on commit 9a734d3

Please sign in to comment.