Skip to content

Commit

Permalink
Update GUI (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmitchell authored Oct 10, 2024
1 parent e0c5e40 commit 32554e1
Show file tree
Hide file tree
Showing 18 changed files with 740 additions and 337 deletions.
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

0 comments on commit 32554e1

Please sign in to comment.