Skip to content

Commit

Permalink
added default keyword arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmitchell committed Nov 6, 2023
1 parent 15f6f9f commit 0d99cd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Further, a second table (labeled as ```*_flanks.txt```) containing information r
* 3' Flanking Sequence Bracketed Notation
* Potential Issues (such as: Possible indel or partial sequence)

The ```Potential Issues``` column in this report is to draw attention to potential problem sequences (due to perhaps an indel or partial sequence) and requires the attention of the user to further evaluate the sequence for it's authenticity.
The ```Potential Issues``` column in this report is to draw attention to potential problem sequences (due to perhaps an indel or partial sequence) and requires the attention of the user to further evaluate the sequence for its authenticity.

Individual marker plots displaying reads vs. CE allele are created in PDF format. They are stored in the ```MarkerPlots/``` directory of the working directory:
* The first page of the PDF file contains the marker plots using a custom y-axis scale (i.e. the y-axis is scaled for each individual marker).
Expand Down
12 changes: 6 additions & 6 deletions lusSTR/wrappers/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,19 @@ def sort_table(table):
return sorted_table


def marker_plots(df, output_name, sex):
def marker_plots(df, output_name, sex=False):
Path("MarkerPlots").mkdir(parents=True, exist_ok=True)
df["CE_Allele"] = df["CE_Allele"].astype(float)
for id in df["SampleID"].unique():
sample_id = f"{id}_sexchr" if sex else id
with PdfPages(f"MarkerPlots/{output_name}_{sample_id}_marker_plots.pdf") as pdf:
make_plot(df, id, sex, False)
make_plot(df, id, sex, sameyaxis=False)
pdf.savefig()
make_plot(df, id, sex, True)
make_plot(df, id, sex)
pdf.savefig()


def make_plot(df, id, sex, sameyaxis):
def make_plot(df, id, sex=False, sameyaxis=True):
sample_df = df[df["SampleID"] == id]
sample_id = f"{id}_sexchr" if sex else id
max_reads = max(sample_df["Reads"])
Expand Down Expand Up @@ -238,7 +238,7 @@ def main(input, out, kit, uas, sex, nocombine):
sex_final_table.to_csv(f"{output_name}_sexloci.txt", sep="\t", index=False)
else:
sex_final_table.to_csv(f"{output_name}_sexloci.txt", sep="\t", index=False)
marker_plots(sex_final_table, output_name, True)
marker_plots(sex_final_table, output_name, sex=True)
if not uas:
if not autosomal_final_table.empty:
autosomal_flank_table.to_csv(f"{output_name}_flanks.txt", sep="\t", index=False)
Expand All @@ -250,7 +250,7 @@ def main(input, out, kit, uas, sex, nocombine):
autosomal_final_table.to_csv(out, sep="\t", index=False)
else:
autosomal_final_table.to_csv(out, sep="\t", index=False)
marker_plots(autosomal_final_table, output_name, False)
marker_plots(autosomal_final_table, output_name)


if __name__ == "__main__":
Expand Down

0 comments on commit 0d99cd1

Please sign in to comment.