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

Fix coordinate conversion for BEDPE files #40

Merged
merged 4 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
12 changes: 6 additions & 6 deletions docs/04_Metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ Aggregated cluster of breakpoint pileups
|id|String|Combined ID retaining the IDs of all constituent breakpoints|
|category|BreakpointCategory|Breakpoint category|
|left_contig|String|Contig name for left side of breakpoint|
|left_min_pos|Int|Minimum coordinate of left breakends|
|left_max_pos|Int|Maximum coordinate of left breakends|
|left_min_pos|Int|Minimum coordinate of left breakends (1-based)|
|left_max_pos|Int|Maximum coordinate of left breakends (1-based)|
|left_strand|Char|Strand at left breakends|
|right_contig|String|Contig name for right side of breakpoint|
|right_min_pos|Int|Minimum coordinate of right breakends|
|right_max_pos|Int|Maximum coordinate of right breakends|
|right_min_pos|Int|Minimum coordinate of right breakends (1-based)|
|right_max_pos|Int|Maximum coordinate of right breakends (1-based)|
|right_strand|Char|Strand at right breakends|
|split_reads|Int|Total number of split reads supporting the breakpoints in the cluster|
|read_pairs|Int|Total number of read pairs supporting the breakpoints in the cluster|
Expand Down Expand Up @@ -82,10 +82,10 @@ the only information comes from read-pairs and the breakpoint information should
|------|----|-----------|
|id|String|An ID assigned to the breakpoint that can be used to lookup supporting reads in the BAM.|
|left_contig|String|The contig of chromosome on which the left hand side of the breakpoint exists.|
|left_pos|Int|The position (possibly imprecise) of the left-hand breakend.|
|left_pos|Int|The position (possibly imprecise) of the left-hand breakend (1-based).|
|left_strand|Char|The strand of the left-hand breakend; sequence reads would traverse this strand in order to arrive at the breakend and transit into the right-hand side of the breakpoint.|
|right_contig|String|The contig of chromosome on which the left hand side of the breakpoint exists.|
|right_pos|Int|The position (possibly imprecise) of the right-hand breakend.|
|right_pos|Int|The position (possibly imprecise) of the right-hand breakend (1-based).|
|right_strand|Char|The strand of the right-hand breakend;. sequence reads would continue reading onto this strand after transiting the breakpoint from the left breakend|
|split_reads|Int|The number of templates/inserts with split-read alignments that identified this breakpoint.|
|read_pairs|Int|The number of templates/inserts with read-pair alignments (and without split-read alignments) that identified this breakpoint.|
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/AggregateSvPileup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ of the overlapping target regions are copied from the `SvPiluep` input (if prese
The output file is a tab-delimited table with one record per aggregated cluster of pileups. Aggregated
pileups are reported with the minimum and maximum (inclusive) coordinates of all pileups in the cluster, a
possible putative structural variant event type supported by the pileups, and the sum of read support from all
pileups in the cluster.
pileups in the cluster. Positions in this file are 1-based positions.

## Arguments

Expand Down
4 changes: 2 additions & 2 deletions docs/tools/SvPileup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Two output files will be created:

1. `<output-prefix>.txt`: a tab-delimited file describing SV pileups, one line per breakpoint event. The returned
breakpoint will be canonicalized such that the "left" side of the breakpoint will have the lower (or equal to)
position on the genome vs. the "right"s side.
position on the genome vs. the "right"s side. Positions in this file are 1-based positions.
2. `<output-prefix>.bam`: a SAM/BAM file containing reads that contain SV breakpoint evidence annotated with SAM
tag.
tag.

The `be` SAM tag contains a comma-delimited list of breakpoints to which a given alignment belongs. Each element is
semi-colon delimited, with four fields:
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: fgsv tools

# fgsv tools

The following tools are available in fgsv version 0.1.1-acc9276.
The following tools are available in fgsv version 0.2.0-d603e95.
## Breakpoint and SV Tools

Primary tools for calling and transforming breakpoints and SVs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import com.fulcrumgenomics.util.Metric
*
* @param id an ID assigned to the breakpoint that can be used to lookup supporting reads in the BAM.
* @param left_contig the contig of chromosome on which the left hand side of the breakpoint exists.
* @param left_pos the position (possibly imprecise) of the left-hand breakend.
* @param left_pos the position (possibly imprecise) of the left-hand breakend (1-based).
* @param left_strand the strand of the left-hand breakend; sequence reads would traverse this strand
* in order to arrive at the breakend and transit into the right-hand side of the breakpoint.
* @param right_contig the contig of chromosome on which the left hand side of the breakpoint exists.
* @param right_pos the position (possibly imprecise) of the right-hand breakend.
* @param right_pos the position (possibly imprecise) of the right-hand breakend (1-based).
* @param right_strand the strand of the right-hand breakend;. sequence reads would continue reading onto
* this strand after transiting the breakpoint from the left breakend
* @param split_reads the number of templates/inserts with split-read alignments that identified this breakpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import scala.collection.mutable
|The output file is a tab-delimited table with one record per aggregated cluster of pileups. Aggregated
|pileups are reported with the minimum and maximum (inclusive) coordinates of all pileups in the cluster, a
|possible putative structural variant event type supported by the pileups, and the sum of read support from all
|pileups in the cluster.
|pileups in the cluster. Positions in this file are 1-based positions.
|""")
class AggregateSvPileup
(@arg(flag='i', doc="Input text file of pileups generated by SvPileup") input: FilePath,
Expand Down Expand Up @@ -230,12 +230,12 @@ object BreakpointCategory extends Enumeration {
* @param id Combined ID retaining the IDs of all constituent breakpoints
* @param category Breakpoint category
* @param left_contig Contig name for left side of breakpoint
* @param left_min_pos Minimum coordinate of left breakends
* @param left_max_pos Maximum coordinate of left breakends
* @param left_min_pos Minimum coordinate of left breakends (1-based)
* @param left_max_pos Maximum coordinate of left breakends (1-based)
* @param left_strand Strand at left breakends
* @param right_contig Contig name for right side of breakpoint
* @param right_min_pos Minimum coordinate of right breakends
* @param right_max_pos Maximum coordinate of right breakends
* @param right_min_pos Minimum coordinate of right breakends (1-based)
* @param right_max_pos Maximum coordinate of right breakends (1-based)
clintval marked this conversation as resolved.
Show resolved Hide resolved
* @param right_strand Strand at right breakends
* @param split_reads Total number of split reads supporting the breakpoints in the cluster
* @param read_pairs Total number of read pairs supporting the breakpoints in the cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ object AggregateSvPileupToBedPE {
def apply(pileup: AggregatedBreakpointPileup): BedPE = {
new BedPE(
chrom1 = pileup.left_contig,
start1 = pileup.left_min_pos,
end1 = pileup.left_max_pos + 1,
start1 = pileup.left_min_pos - 1,
end1 = pileup.left_max_pos,
chrom2 = pileup.right_contig,
start2 = pileup.right_min_pos,
end2 = pileup.right_max_pos + 1,
start2 = pileup.right_min_pos - 1,
end2 = pileup.right_max_pos,
name = pileup.id,
score = pileup.total,
strand1 = Strand.decode(pileup.left_strand),
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/fulcrumgenomics/sv/tools/SvPileup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ object TargetBedRequirement extends FgBioEnum[TargetBedRequirement] {
|
|1. `<output-prefix>.txt`: a tab-delimited file describing SV pileups, one line per breakpoint event. The returned
| breakpoint will be canonicalized such that the "left" side of the breakpoint will have the lower (or equal to)
| position on the genome vs. the "right"s side.
| position on the genome vs. the "right"s side. Positions in this file are 1-based positions.
|2. `<output-prefix>.bam`: a SAM/BAM file containing reads that contain SV breakpoint evidence annotated with SAM
| tag.
| tag.
|
|The `be` SAM tag contains a comma-delimited list of breakpoints to which a given alignment belongs. Each element is
|semi-colon delimited, with four fields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ class AggregateSvPileupToBedPETest extends UnitSpec {
id = "112",
category = "Inter-contig rearrangement",
left_contig = "chr1",
left_min_pos = 100,
left_max_pos = 100,
left_min_pos = 101,
left_max_pos = 101,
left_strand = '+',
right_contig = "chr3",
right_min_pos = 200,
right_max_pos = 200,
right_min_pos = 201,
right_max_pos = 201,
right_strand = '-',
split_reads = 1,
read_pairs = 1,
total = 2,
left_pileups = PositionList(100),
right_pileups = PositionList(200),
left_pileups = PositionList(101),
right_pileups = PositionList(201),
)

/** A companion test BEDPE record. */
Expand Down