Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GUI #80

Merged
merged 24 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1dc9689
initial commit
rnmitchell Sep 13, 2024
eba3999
working on interactive data editing [skip ci]
rnmitchell Sep 20, 2024
139fa25
fix bug in editing allele calls [skip ci]
rnmitchell Sep 23, 2024
e8bef32
added dropdown menu for multiple samples; added button for generating…
rnmitchell Sep 23, 2024
d08571d
added code to create new strmix/efm output files using edited data [s…
rnmitchell Sep 23, 2024
2334e12
added flagging of problematic loci [skip ci]
rnmitchell Sep 24, 2024
c3a6288
config settings can be automatically uploaded for previously run data…
rnmitchell Sep 24, 2024
f1e9ddb
change real_allele to Typed [skip ci]
rnmitchell Sep 24, 2024
5439462
added flagging of problem loci in dropdown menu [skip ci]
rnmitchell Sep 24, 2024
525c611
fixed bug with flagging correct loci for >1 sample [skip ci]
rnmitchell Sep 24, 2024
2d72bb1
updated tests using Typed instead of real_allele
rnmitchell Sep 24, 2024
cdb411b
added plotly to setup.py
rnmitchell Sep 24, 2024
c496e7f
updated filter script from real_allele to Typed
rnmitchell Sep 24, 2024
dc2b951
plotting all markers on same screen [skip ci]
rnmitchell Oct 4, 2024
e2c153a
make 4 plots per line [skip ci]
rnmitchell Oct 4, 2024
6cab42c
saving edited marker plots [skip ci]
rnmitchell Oct 4, 2024
1e2ca59
added flagged markers to page with all markers [skip ci]
rnmitchell Oct 4, 2024
7cbc66e
added border around marker plots in all markers page
rnmitchell Oct 4, 2024
7d7e898
fixed bug with flagged markers
rnmitchell Oct 9, 2024
2915923
updated README [skip ci]
rnmitchell Oct 9, 2024
1c5bad7
added Deleted as allele type option
rnmitchell Oct 9, 2024
ef170cc
removed old code
rnmitchell Oct 9, 2024
3630e88
not sure why one of the tests was hashed out
rnmitchell Oct 10, 2024
25fc0a9
removed hashed code
rnmitchell Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ Once lusSTR has been installed, the GUI can be started with the command:
```
lusstr gui
```
All lusSTR settings for either the STR pipeline or the SNP pipeline can be specified after selecting the desired pipeline tab.
All lusSTR settings for either the STR pipeline or the SNP pipeline can be specified after selecting the desired pipeline tab.

The GUI provides an option to view marker plots interactively and manually edit the sequence type after lusSTR is complete.
There is also an option to upload previously run data to view. See the last STR section (```View and Edit lusSTR data```) for more information.
____

## *Command line interface*
Expand Down Expand Up @@ -210,8 +213,24 @@ When using STRmix data, the data type can be specified using the ```data-type```

Finally, output files are created for direct use in EuroForMix (EFM), MPSproto or STRmix. If EFM or MPSproto is specified, a single file is created containing all samples in the input file (however, separate output files for each sample can be created with the ```separate``` setting specified in the config file). If STRmix is specified, a directory containing files for each individual sample is created. The ```profile-type``` setting allows for the creation of either a ```reference``` or ```evidence``` profile. Both EuroForMix/MPSproto and STRmix require different formatting depending on the type of sample.

---

### View and Edit lusSTR data

The ```See Individual Marker Plots & Data``` button at the bottom of the lusSTR STR page can be run either directly after a lusSTR run (e.g. the settings have already been specified) or the user can upload previously-run lusSTR data by uploading the lusSTR output folder using the ```Select an Output Folder``` button. If using previously run data, the configuration settings within the ```config.yaml``` file in that folder will automatically be loaded and used. If other settings are desired, please re-run lusSTR using the new settings.

Once the ```See Individual Marker Plots & Data``` button has been pressed, the sample of interest can be selected from the dropdown menu (if multiple samples are present). The first screen contains the marker plots for all autosomal STRs. Individual markers can be selected from the dropdown menu. Markers with potential issues are flagged with a caution symbol.

On the individual marker pages, the ```allele_type``` column can be changed (no other column in the data table can be edited). A dropdown menu will appear to change the assigned allele type for a specific sequence. If a type is changed, the page will automatically refresh and the marker plot will be updated with the edited changes. The user may edit multiple markers and samples.

Once all desired changes are made, selecting the "Save Edits" button will create the following files containing the changes:
1. New final lusSTR output files (either ```STRmix``` or ```EFM``` files as generated previously with lusSTR)
2. New allele information file
3. New PDFs of the marker plots
The new files are automatically generated into a folder labeled as: ```edited_date_time``` (e.g. ```edited_10042024_16_29_50```)
___


## SNP Data Processing

lusSTR is able to process SNPs derived from the ForenSeq Signature Prep assay and the ForenSeq Kintelligence assay. SNPs from the ForenSeq Signature Prep assay could be analyzed using either the Verogen UAS or STRait Razor. SNPs from the ForenSeq Kintelligence assay must first be analyzed using the UAS.
Expand Down
12 changes: 5 additions & 7 deletions lusSTR/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@
from lusSTR.cli import snps
from lusSTR.cli import gui

mains = {
"config": config.main,
"strs": strs.main,
"snps": snps.main,
"gui": gui.main
}
mains = {"config": config.main, "strs": strs.main, "snps": snps.main, "gui": gui.main}

subparser_funcs = {
"config": config.subparser,
"strs": strs.subparser,
"snps": snps.subparser,
"gui": gui.subparser
"gui": gui.subparser,
}


def main(args=None):
if args is None:
args = get_parser().parse_args()
Expand All @@ -36,6 +32,7 @@ def main(args=None):
result = mainmethod(args)
return result


def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
Expand All @@ -47,5 +44,6 @@ def get_parser():
func(subparsers)
return parser


if __name__ == "__main__":
main()
89 changes: 54 additions & 35 deletions lusSTR/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,83 +101,102 @@ def edit_str_config(config, args):
def subparser(subparsers):
p = subparsers.add_parser("config", description="Create config file for running STR pipeline")
p.add_argument(
"-w", "--workdir", metavar="W", default=".",
help="directory to add config file; default is current working directory")
"-w",
"--workdir",
metavar="W",
default=".",
help="directory to add config file; default is current working directory",
)
p.add_argument(
"-a", "--analysis-software", choices=["uas", "straitrazor", "genemarker"], default="uas",
dest="asoftware", help="Analysis software program used prior to lusSTR. Choices are uas, "
"straitrazor or genemarker. Default is uas."
"-a",
"--analysis-software",
choices=["uas", "straitrazor", "genemarker"],
default="uas",
dest="asoftware",
help="Analysis software program used prior to lusSTR. Choices are uas, "
"straitrazor or genemarker. Default is uas.",
)
p.add_argument("--input", help="Input file or directory")
p.add_argument("--out", "-o", help="Output file/directory name")
p.add_argument(
"--powerseq", action="store_true",
help="Use to indicate sequences were created using the PowerSeq Kit."
"--powerseq",
action="store_true",
help="Use to indicate sequences were created using the PowerSeq Kit.",
)
p.add_argument(
"--sex", action="store_true",
"--sex",
action="store_true",
help="Use if including the X and Y STR markers. Separate reports for these markers "
"will be created.",
)
p.add_argument(
"--nocombine", action="store_true",
"--nocombine",
action="store_true",
help="Do not combine read counts for duplicate sequences within the UAS region "
"during the 'convert' step. By default, read counts are combined for sequences "
"not run through the UAS.",
)
p.add_argument(
"--reference", action="store_true",
help="Use for creating Reference profiles for STR workflow"
"--reference",
action="store_true",
help="Use for creating Reference profiles for STR workflow",
)
p.add_argument(
"--software", choices=["efm", "mpsproto", "strmix"], default="strmix",
"--software",
choices=["efm", "mpsproto", "strmix"],
default="strmix",
help="Specify the probabilistic genotyping software package of choice. The final output"
" files will be in the correct format for direct use. Default is strmix."
" files will be in the correct format for direct use. Default is strmix.",
)
p.add_argument(
"--str-type", choices=["ce", "ngs", "lusplus"], default="ngs",
dest="datatype", help="Data type for STRs. Options are: CE allele ('ce'), sequence "
"--str-type",
choices=["ce", "ngs", "lusplus"],
default="ngs",
dest="datatype",
help="Data type for STRs. Options are: CE allele ('ce'), sequence "
"or bracketed sequence form('ngs'), or LUS+ allele ('lusplus'). Default is 'ngs'.",
)
p.add_argument(
"--noinfo", action="store_true",
help="Use to not create the Sequence Information File in the 'filter' step"
"--noinfo",
action="store_true",
help="Use to not create the Sequence Information File in the 'filter' step",
)
p.add_argument(
"--separate", action="store_true",
"--separate",
action="store_true",
help="Use to separate EFM profiles in the 'filter' step. If specifying for SNPs, "
"each sample will also be separated into 10 different bins for mixture deconvolution."
"each sample will also be separated into 10 different bins for mixture deconvolution.",
)
p.add_argument(
"--nofiltering", action="store_true",
"--nofiltering",
action="store_true",
help="For STRs, use to perform no filtering during the 'filter' step. For SNPs, "
"only alleles specified as 'Typed' by the UAS will be included at the 'format' step."
"only alleles specified as 'Typed' by the UAS will be included at the 'format' step.",
)
p.add_argument(
"--snps", action="store_true",
help="Use to create a config file for the SNP workflow"
"--snps", action="store_true", help="Use to create a config file for the SNP workflow"
)
p.add_argument(
"--snp-type", default="all", dest="snptype",
"--snp-type",
default="all",
dest="snptype",
help="Specify the type of SNPs to include in the final report. 'p' will include only the "
"Phenotype SNPs; 'a' will include only the Ancestry SNPs; 'i' will include only the "
"Identity SNPs; and 'all' will include all SNPs. More than one type can be specified (e.g. "
" 'p, a'). Default is all."
" 'p, a'). Default is all.",
)
p.add_argument(
"--kintelligence", action="store_true",
help="Use if processing Kintelligence SNPs within a Kintellience Report(s)"
"--kintelligence",
action="store_true",
help="Use if processing Kintelligence SNPs within a Kintellience Report(s)",
)
p.add_argument(
"--snp-reference", dest="ref",
help="Specify any references for SNP data for use in EFM."
"--snp-reference", dest="ref", help="Specify any references for SNP data for use in EFM."
)
p.add_argument(
"--strand", choices=["uas", "forward"],
"--strand",
choices=["uas", "forward"],
help="Specify the strand orientation for the final output files. UAS orientation is "
"default for STRs; forward strand is default for SNPs."
)
p.add_argument(
"--custom", action="store_true",
help="Specifying custom sequence ranges."
"default for STRs; forward strand is default for SNPs.",
)
p.add_argument("--custom", action="store_true", help="Specifying custom sequence ranges.")
Loading
Loading