Skip to content

Tagpileup overhaul#98

Merged
WilliamKMLai merged 11 commits intomasterfrom
tagpileup-overhaul
Oct 14, 2022
Merged

Tagpileup overhaul#98
WilliamKMLai merged 11 commits intomasterfrom
tagpileup-overhaul

Conversation

@owlang
Copy link
Copy Markdown
Collaborator

@owlang owlang commented Oct 13, 2022

Add support for 3' end and full fragment pileup--restructure Read encoding parameters into Read Aspect and Read Type (#70)
Add support for TagExtend (#73)
Add read encoding graphic/cartoon for clarity in parameter selection

owlang added 11 commits January 4, 2022 01:05
Two variables renamed in PileupExtract: BEDCoord `read` renamed to `coord` and int variable specifying marked location of for pileup renamed from `FivePrime` to `mark`

The BEDCoord is renamed to specify it as different from the SAMRecord objects.

The int type variable is renamed `mark` because the variable is/will be used to mark features other than just the FivePrime end including the three prime end and midpoint.
There is a lot of redundant code that this commit helps to streamline for future development.
-ReadType directly updated instead of changing intermediate variables
-RequirePE directly updated instead of changing intermediate variables
-Output Matrix validation structures dramatically consolidated:
  -No matrix output vs make default matrix basename vs user provides matrix basename
	-Output type flags related to matrix validated once
	-Default basename construction left to TagPileup script like TagPileupWindow
	-PileupParams output directory assigned a value as needed
	-parent directory of matrix basename validated if user provided
-Strand directly updated instead of changing intermediate variables (like changing when ReadType=midpoint)
Relating to issue #70, this commit separates out the "Read Output" selection into the Read Output:{read1, read2, allreads} and the Read Aspect:{5prime, 3prime, midpoint}. This new feature has been checked on some simple test data for 3' end. This sets the new parameter structure for filling in with new features.

PileupParameters
-`ASPECT` variable added with descriptive comment and getter/setter methods
-`READ` variable's descriptive comments updated to remove "midpoint"
-`printall()` method updated to include `ASPECT` variable

PileupExtract
-Midpoint parameter check changed from `param.getRead() == 3` to `param.getAspect() == 2`
-Setting `mark` value now accounts for Read Aspect selected:
  -select start/left mark or end/right mark as appropriate for Read Aspect and reference strand values
  -Two places in the code: paired-end data conditional block and single-end conditional block
-some heavier boolean logic was added to the paired data `firstOfPairFlag()` check against the Read Output parameter so that it includes the Read Aspect parameter
-Separate SHIFT code into its own conditional block independently based on reference strand value alone

TagPileup
-update default file naming to include read aspect information

TagPileupWindow
-Window design:
  -add "Read Aspect" radiobutton selection options (with 5prime and 3prime and midpoint options)
  -remove "Midpoint" option from "Read Output"
  -components on right side of the window were vertically squished to fit with the new "Read Aspect" components (many `putConstraint()` lines changed)
-update assignment of Read Aspect & Read type values to the PileupParameters object in the `Task` class
-update radiobutton listeners to listen to "Read Aspect" choices rather than "Read Output" choices
-`allowReadChoice()` method was updated to enable/disable Read Type selection components (keep enable/disable strand components, separate/combined)

TagPileupCLI
-Add new argument group for assigning Read Aspect value
-Remove "midpoint" argument option from Read Type value
-propagate changes to affected midpoint validation lines
Relating to issue #70

Add "Full Fragment" to read Aspect options in TagPileupWindow
-new radio button to readAspect button group
-separate out allow read choice and strand choice into separate methods
-allow strand choice for Full fragment (strand determined by R1 strand"
Update objects/PileupParameters with new read aspect option
Update TagPileup to use an appropriate default output filename suffix
Recode scripts/Read_Analysis/PileupScripts/PileupExtract.java to account for full fragment option
-use mark variable to mark the beginning (lower coordinate index) of the fragment
-when adding marks, loop through values from mark to mark+insertsize
Missed auto-selection of "combined" strandedness when full fragment is selected.

#70
The logic for restricting alignment records to properly paired when midpoint or fragment are specified was incorrect. This commit fixes the error

#70
Previous commit for 3' and Fragment feature additions was buggy. This code restructure clarifies the ReadAspect & ReadOutput logic with expansion to include TagExtend in mind.
#70
The `PileupParameters` object had "TagExtend" added with a fixed intialized value (not set yet by `TagPileupWindow` or `TagPileupCLI`)

Each SAMRecord processed by a helper method that is determined by the Read Aspect value. Similar structure to v0.13 TagPileup within each helper method.
TagExtend support already accounted for in TagPileup script. This commit allows the user to set a value from the GUI. The selection box was put where CPU setting used to be and CPU setting was moved over in the window interface. "Output Parameters" section label was removed.
#73
Cosmetic reorganization of file output parameter selection components to take up less space (restrict to lower left section)
This commit primarily takes care of adding the read fragment cartoon to clarify parameter selection for users. #71
TagPileupWindow:
- create instance of cartoon component and add to the window frame
- adjust other components as necessary to maintain balance and function
- add method to update cartoon when read aspect or read type are toggled
ReadFragmentCartoon:
- create graphic component object that can be updated and repainted in response to changes to "aspect" and "read"
- add JavaDocs comments
PileupParameters
- add and reorganize fields to include final static integers that track the encodings for each parameter (like aliases)
@owlang owlang requested a review from WilliamKMLai October 13, 2022 20:52
@WilliamKMLai WilliamKMLai merged commit accf3ff into master Oct 14, 2022
@WilliamKMLai WilliamKMLai deleted the tagpileup-overhaul branch October 14, 2022 13:10
@HeninChen HeninChen restored the tagpileup-overhaul branch January 7, 2023 21:39
@owlang owlang deleted the tagpileup-overhaul branch February 28, 2023 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants