-
Notifications
You must be signed in to change notification settings - Fork 596
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
Added optional mappability and segmental-duplication annotation to AnnotateIntervals. #5162
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7c859e1
Added optional mappability and segmental-duplication annotation to An…
samuelklee 73f5409
Updated AnnotateIntervals task and calls in WDL (untested).
samuelklee f06546b
Addressed PR comments.
samuelklee 3c22dda
Addressed PR comment.
samuelklee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions; | ||
import org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection; | ||
import org.broadinstitute.hellbender.engine.ReferenceDataSource; | ||
import org.broadinstitute.hellbender.exceptions.UserException; | ||
import org.broadinstitute.hellbender.testutils.ArgumentsBuilder; | ||
import org.broadinstitute.hellbender.tools.copynumber.formats.collections.AnnotatedIntervalCollection; | ||
import org.broadinstitute.hellbender.tools.copynumber.formats.collections.AnnotatedIntervalCollectionUnitTest; | ||
|
@@ -37,6 +38,8 @@ public final class AnnotateIntervalsIntegrationTest extends CommandLineProgramTe | |
"annotate-intervals-hg19-umap-k100-single-read-mappability-merged-20-21.bed.gz"); | ||
private static final File SEGMENTAL_DUPLICATION_TRACK_FILE = new File(TEST_SUB_DIR, | ||
"annotate-intervals-hg19-segmental-duplication-20-21.bed.gz"); | ||
private static final File SEGMENTAL_DUPLICATION_WITH_OVERLAPS_TRACK_FILE = new File(TEST_SUB_DIR, | ||
"annotate-intervals-hg19-segmental-duplication-20-21-with-overlaps.bed.gz"); | ||
|
||
private static final SAMSequenceDictionary SEQUENCE_DICTIONARY = ReferenceDataSource.of(REFERENCE_FILE.toPath()).getSequenceDictionary(); | ||
private static final LocatableMetadata LOCATABLE_METADATA = new SimpleLocatableMetadata(SEQUENCE_DICTIONARY); | ||
|
@@ -45,7 +48,7 @@ public final class AnnotateIntervalsIntegrationTest extends CommandLineProgramTe | |
* Test case checks that intervals are sorted according to {@link #SEQUENCE_DICTIONARY} and | ||
* adjacent intervals are not merged. This test case is also used in {@link AnnotatedIntervalCollectionUnitTest}. | ||
*/ | ||
private static final AnnotatedIntervalCollection EXPECTED_ALL_ANNOTATIONS = new AnnotatedIntervalCollection( | ||
public static final AnnotatedIntervalCollection EXPECTED_ALL_ANNOTATIONS = new AnnotatedIntervalCollection( | ||
LOCATABLE_METADATA, | ||
Arrays.asList( | ||
new AnnotatedInterval(new SimpleInterval("20", 1000001, 1001000), | ||
|
@@ -68,6 +71,11 @@ public final class AnnotateIntervalsIntegrationTest extends CommandLineProgramTe | |
Pair.of(CopyNumberAnnotations.GC_CONTENT, 0.448), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add another interval which partially overlaps with intervals in mappability track? |
||
Pair.of(CopyNumberAnnotations.MAPPABILITY, 1.), | ||
Pair.of(CopyNumberAnnotations.SEGMENTAL_DUPLICATION_CONTENT, 0.)))), | ||
new AnnotatedInterval(new SimpleInterval("20", 1238001, 1239000), | ||
new AnnotationMap(Arrays.asList( | ||
Pair.of(CopyNumberAnnotations.GC_CONTENT, 0.3), | ||
Pair.of(CopyNumberAnnotations.MAPPABILITY, 1.), | ||
Pair.of(CopyNumberAnnotations.SEGMENTAL_DUPLICATION_CONTENT, 0.218)))), | ||
new AnnotatedInterval(new SimpleInterval("21", 1, 100), | ||
new AnnotationMap(Arrays.asList( | ||
Pair.of(CopyNumberAnnotations.GC_CONTENT, Double.NaN), | ||
|
@@ -153,6 +161,18 @@ public void testAllAnnotations() { | |
Assert.assertNotSame(result, expected); | ||
} | ||
|
||
@Test(expectedExceptions = UserException.BadInput.class) | ||
public void testSegmentalDuplicationContentWithOverlaps() { | ||
final File outputFile = createTempFile("annotate-intervals-test", ".tsv"); | ||
final ArgumentsBuilder argsBuilder = new ArgumentsBuilder() | ||
.addReference(REFERENCE_FILE) | ||
.addFileArgument(AnnotateIntervals.SEGMENTAL_DUPLICATION_TRACK_PATH_LONG_NAME, SEGMENTAL_DUPLICATION_WITH_OVERLAPS_TRACK_FILE) | ||
.addArgument(StandardArgumentDefinitions.INTERVALS_LONG_NAME, INTERVALS_FILE.getAbsolutePath()) | ||
.addArgument(IntervalArgumentCollection.INTERVAL_MERGING_RULE_LONG_NAME, IntervalMergingRule.OVERLAPPING_ONLY.toString()) | ||
.addOutput(outputFile); | ||
runCommandLine(argsBuilder); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testIntervalSetRule() { | ||
final File resultOutputFile = createTempFile("annotate-intervals-test", ".tsv"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+1.9 KB
...tools/copynumber/annotate-intervals-hg19-segmental-duplication-20-21-with-overlaps.bed.gz
Binary file not shown.
Binary file added
BIN
+2.58 KB
...s/copynumber/annotate-intervals-hg19-segmental-duplication-20-21-with-overlaps.bed.gz.tbi
Binary file not shown.
Binary file modified
BIN
-140 KB
(18%)
.../copynumber/annotate-intervals-hg19-umap-k100-single-read-mappability-merged-20-21.bed.gz
Binary file not shown.
Binary file modified
BIN
-24.1 KB
(32%)
...ynumber/annotate-intervals-hg19-umap-k100-single-read-mappability-merged-20-21.bed.gz.tbi
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
20 1001001 1002000 + . | ||
20 1002001 1003000 + . | ||
20 1003001 1004000 + . | ||
20 1238001 1239000 + . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to assign a score of 0 if a region is not in the mappability track?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is what we indicate in the documentation.