public class SAMToMappingPlugin
Plugin to take mapped reads to the pangenome in a SAM file and prepare and upload the ReadMappings to the DB.
This plugin uses a Keyfile containing the following columns: cultivar, flowcell_lane, filename, and PlateID It will then walk through each entry in the keyfile and will attempt to prepare the SAM file to create ReadMappings
A number of filtering steps are done to improve the quality of the information stored in the db.
Only equally optimal mappings(By Edit Distance(NM) are kept)
Additional filtering is done to remove reads which are unmapped or clipped
If running in paired mode, the reads must be on opposite strands and both must currently hit the same haplotype in a single reference range.
Optimal mappings across reference ranges are processed, but reads are only assigned to haplotypes in the reference range with the most hits(providing that at least 1- maxRefRangeError percentage hit that refRange) Based on testing, this seems to be working the best to balance #of reads used with accuracy.
public SAMToMappingPlugin(@Nullable java.awt.Frame parentFrame, boolean isInteractive)
Plugin to take mapped reads to the pangenome in a SAM file and prepare and upload the ReadMappings to the DB.
This plugin uses a Keyfile containing the following columns: cultivar, flowcell_lane, filename, and PlateID It will then walk through each entry in the keyfile and will attempt to prepare the SAM file to create ReadMappings
A number of filtering steps are done to improve the quality of the information stored in the db.
Only equally optimal mappings(By Edit Distance(NM) are kept)
Additional filtering is done to remove reads which are unmapped or clipped
If running in paired mode, the reads must be on opposite strands and both must currently hit the same haplotype in a single reference range.
Optimal mappings across reference ranges are processed, but reads are only assigned to haplotypes in the reference range with the most hits(providing that at least 1- maxRefRangeError percentage hit that refRange) Based on testing, this seems to be working the best to balance #of reads used with accuracy.
@Nullable public net.maizegenetics.plugindef.DataSet processData(@Nullable net.maizegenetics.plugindef.DataSet input)
public void runGraphlessSamToMapping()
This function will run the SAM -> ReadMapping File portion of the pipeline without needing DB access or a graph input.
public void runGraphSamToMapping(@NotNull HaplotypeGraph graph)
This function will run the SAM -> ReadMapping File portion of the pipeline and will write to the DB.
@Nullable public javax.swing.ImageIcon getIcon()
@NotNull public java.lang.String getButtonName()
@NotNull public java.lang.String getToolTipText()
@NotNull public java.lang.String keyFile()
Name of the Keyfile to process. Must have columns cultivar, flowcell_lane, filename, and PlateID. Optionally for paired end reads, filename2 is needed. If filename2 is not supplied, Minimap2 will run in single end mode. Otherwise will be paired.
@NotNull public SAMToMappingPlugin keyFile(@NotNull java.lang.String value)
Set keyFile. Name of the Keyfile to process. Must have columns cultivar, flowcell_lane, filename, and PlateID. Optionally for paired end reads, filename2 is needed. If filename2 is not supplied, Minimap2 will run in single end mode. Otherwise will be paired.
value
- keyFile@NotNull public java.lang.String samDir()
Name of the SAM/BAM dir to process.
@NotNull public SAMToMappingPlugin samDir(@NotNull java.lang.String value)
Set SAM/BAM dir to process. Name of the SAM/BAM dir to process.
value
- SAM/BAM dir to processpublic double maxRefRangeError()
Maximum allowed error when choosing best reference range to count. Error is computed 1 - (mostHitRefCount/totalHits)
@NotNull public SAMToMappingPlugin maxRefRangeError(double value)
Set Max Ref Range Err. Maximum allowed error when choosing best reference range to count. Error is computed 1
(mostHitRefCount/totalHits)
value
- Max Ref Range Errpublic boolean lowMemMode()
Run in low memory mode.
@NotNull public SAMToMappingPlugin lowMemMode(boolean value)
Set Low Mem Mode. Run in low memory mode.
value
- Low Mem Mode@NotNull public java.lang.String methodName()
Method name to be stored in the DB.
@NotNull public SAMToMappingPlugin methodName(@NotNull java.lang.String value)
Set Method Name. Method name to be stored in the DB.
value
- Method Name@NotNull public java.lang.String methodDescription()
Method description to be stored in the DB.
@NotNull public SAMToMappingPlugin methodDescription(@NotNull java.lang.String value)
Set Method Description. Method description to be stored in the DB.
value
- Method Description@NotNull public java.lang.String outputDebugDir()
Directory to write out the read mapping files. This is optional for debug purposes.
@NotNull public SAMToMappingPlugin outputDebugDir(@NotNull java.lang.String value)
Set Debug Directory to write out read Mapping files.. Directory to write out the read mapping files. This is optional for debug purposes.
value
- Debug Directory to write out read Mapping files.public boolean outputSecondaryMappingStats()
Ouptput Secondary Mapping Statistics such as total AS for each haplotype ID
@NotNull public SAMToMappingPlugin outputSecondaryMappingStats(boolean value)
Set Output secondary mapping statistics.. Ouptput Secondary Mapping Statistics such as total AS for each haplotype ID
value
- Output secondary mapping statistics.public boolean isTestMethod()
Indication if the data is to be loaded against a test method. Data loaded with test methods are not cached with the PHG ktor server
@NotNull public SAMToMappingPlugin isTestMethod(boolean value)
Set Is Test Method. Indication if the data is to be loaded against a test method. Data loaded with test methods are not cached with the PHG ktor server
value
- Is Test Methodpublic boolean updateDB()
If set to true, the read mappings will be written to the db. Otherwise nothing will be written.
@NotNull public SAMToMappingPlugin updateDB(boolean value)
Set Update D B. If set to true, the read mappings will be written to the db. Otherwise nothing will be written.
value
- Update D Bpublic boolean runWithoutGraph()
If set to true, will require the input of a JSON file created by CreateHapIdMapsPlugin and will got require a Graph object input.
@NotNull public SAMToMappingPlugin runWithoutGraph(boolean value)
Set Run Without Graph. If set to true, will require the input of a JSON file created by CreateHapIdMapsPlugin and will got require a Graph object input.
value
- Run Without Graph@NotNull public java.lang.String hapIdMapFile()
Location of the HapIdMapFile where the graph Information can be found.
@NotNull public SAMToMappingPlugin hapIdMapFile(@NotNull java.lang.String value)
Set Hap Id Map File. Location of the HapIdMapFile where the graph Information can be found.
value
- Hap Id Map File@NotNull public java.lang.String inputFile()
Input SAM file to be run through. If this is not set it will run everything in the inputDir
@NotNull public SAMToMappingPlugin inputFile(@NotNull java.lang.String value)
Set Input S A M File. Input SAM file to be run through. If this is not set it will run everything in the inputDir
value
- Input S A M File