-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from TheJacksonLaboratory/develop
Develop
- Loading branch information
Showing
309 changed files
with
30,355 additions
and
3,084 deletions.
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 |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
* Copyright 2007-present the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import java.net.*; | ||
import java.io.*; | ||
import java.nio.channels.*; | ||
import java.util.Properties; | ||
|
||
public class MavenWrapperDownloader { | ||
|
||
private static final String WRAPPER_VERSION = "0.5.6"; | ||
/** | ||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. | ||
*/ | ||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" | ||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; | ||
|
||
/** | ||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to | ||
* use instead of the default one. | ||
*/ | ||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = | ||
".mvn/wrapper/maven-wrapper.properties"; | ||
|
||
/** | ||
* Path where the maven-wrapper.jar will be saved to. | ||
*/ | ||
private static final String MAVEN_WRAPPER_JAR_PATH = | ||
".mvn/wrapper/maven-wrapper.jar"; | ||
|
||
/** | ||
* Name of the property which should be used to override the default download url for the wrapper. | ||
*/ | ||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; | ||
|
||
public static void main(String args[]) { | ||
System.out.println("- Downloader started"); | ||
File baseDirectory = new File(args[0]); | ||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); | ||
|
||
// If the maven-wrapper.properties exists, read it and check if it contains a custom | ||
// wrapperUrl parameter. | ||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); | ||
String url = DEFAULT_DOWNLOAD_URL; | ||
if(mavenWrapperPropertyFile.exists()) { | ||
FileInputStream mavenWrapperPropertyFileInputStream = null; | ||
try { | ||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); | ||
Properties mavenWrapperProperties = new Properties(); | ||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); | ||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); | ||
} catch (IOException e) { | ||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); | ||
} finally { | ||
try { | ||
if(mavenWrapperPropertyFileInputStream != null) { | ||
mavenWrapperPropertyFileInputStream.close(); | ||
} | ||
} catch (IOException e) { | ||
// Ignore ... | ||
} | ||
} | ||
} | ||
System.out.println("- Downloading from: " + url); | ||
|
||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); | ||
if(!outputFile.getParentFile().exists()) { | ||
if(!outputFile.getParentFile().mkdirs()) { | ||
System.out.println( | ||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); | ||
} | ||
} | ||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); | ||
try { | ||
downloadFileFromURL(url, outputFile); | ||
System.out.println("Done"); | ||
System.exit(0); | ||
} catch (Throwable e) { | ||
System.out.println("- Error downloading"); | ||
e.printStackTrace(); | ||
System.exit(1); | ||
} | ||
} | ||
|
||
private static void downloadFileFromURL(String urlString, File destination) throws Exception { | ||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { | ||
String username = System.getenv("MVNW_USERNAME"); | ||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); | ||
Authenticator.setDefault(new Authenticator() { | ||
@Override | ||
protected PasswordAuthentication getPasswordAuthentication() { | ||
return new PasswordAuthentication(username, password); | ||
} | ||
}); | ||
} | ||
URL website = new URL(urlString); | ||
ReadableByteChannel rbc; | ||
rbc = Channels.newChannel(website.openStream()); | ||
FileOutputStream fos = new FileOutputStream(destination); | ||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); | ||
fos.close(); | ||
rbc.close(); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
========= | ||
Changelog | ||
========= | ||
|
||
------ | ||
v0.3.0 | ||
------ | ||
- Adding phenopacket support |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. _rstdeletion: | ||
|
||
Deletions | ||
========= | ||
|
||
|
||
A deletion is a type of DNA variant that involves the loss of genetic material. If the loss is over 1 kb, then | ||
the deletion is refered to as a structural variant (Note that svanna prioritizes any deletion that is included | ||
in the input VCF file, even those that are shorter than 1kb). Deletions may also be refered to as a type | ||
of copy number variant (CNV) with copy loss. | ||
|
||
|
||
svanna prioritization of deletions | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
todo | ||
|
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 |
---|---|---|
|
@@ -17,5 +17,5 @@ of germline variants. | |
setup | ||
running | ||
BND<bndannotations> | ||
|
||
structuralvariation | ||
|
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. _rstrunning: | ||
|
||
Running svanna | ||
############## | ||
|
||
|
||
Creating a VCF file | ||
^^^^^^^^^^^^^^^^^^^ | ||
|
||
We have tested svanna with VCF files | ||
generated by the following programs. | ||
|
||
|
||
1. `pbsv <https://github.com/PacificBiosciences/pbsv>`_, an SV caller provided by Pacific Biosciences. Currently, | ||
pbsv calls insertions, deletions, inversions, duplications, and translocations. | ||
|
||
2. `sniffles <https://pubmed.ncbi.nlm.nih.gov/29713083/>`_, todo... |
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 |
---|---|---|
@@ -1,73 +1,84 @@ | ||
.. _rstsetup: | ||
|
||
Setting up svann | ||
Setting up SvAnna | ||
================ | ||
|
||
svann is a desktop Java application that requires several external files to run. | ||
SvAnna is a desktop Java application that requires several external files to run. | ||
|
||
|
||
Prerequisites | ||
~~~~~~~~~~~~~ | ||
|
||
svann was written with Java version 11. If you want to | ||
build svann from source, then the build process described below requires | ||
`Git <https://git-scm.com/book/en/v2>`_ and `maven <https://maven.apache.org/install.html>`_. | ||
SvAnna was written with Java version 11. | ||
`Git <https://git-scm.com/book/en/v2>`_ and | ||
`Java Development Kit <https://www.oracle.com/java/technologies/javase-downloads.html>`_ version 11 or better | ||
are required to build SvAnna from source. Most users should download the prebuilt SvAnna files from the | ||
`Releases page <https://github.com/TheJacksonLaboratory/svann/releases>`_. | ||
|
||
Installation | ||
~~~~~~~~~~~~ | ||
|
||
Go the GitHub page of `svann <https://github.com/pnrobinson/svann>`_, and clone or download the project. | ||
Go the GitHub page of `SvAnna <https://github.com/TheJacksonLaboratory/svann>`_, and clone or download the project. | ||
Build the executable from source with maven, and then test the build. :: | ||
|
||
$ git clone https://github.com/pnrobinson/svann | ||
$ git clone https://github.com/TheJacksonLaboratory/svann | ||
$ cd svann | ||
$ mvn package | ||
$ java -jar target/svann.jar | ||
$ ./mvnw package | ||
$ java -jar svanna-cli/target/svanna-cli.jar | ||
$ Usage: <main class> [options] [command] [command options] | ||
Options: | ||
-h, --help | ||
display this help message | ||
(...) | ||
|
||
|
||
|
||
svann requires `maven <https://maven.apache.org/>`_ version 3.5.3. | ||
|
||
|
||
Prebuilt svann executable | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Prebuilt SvAnna executable | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Alternatively, go to the `Releases section <https://github.com/pnrobinson/svann/releases>`_ on the | ||
svann GitHub page and download the latest precompiled version of svann. | ||
SvAnna GitHub page and download the latest precompiled version of SvAnna. | ||
|
||
|
||
The download command | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. _rstdownload: | ||
|
||
svann requires four additional files to run. TODO update this list! | ||
SvAnna requires four additional files to run. TODO update this list! | ||
|
||
1. ``hp.obo``. The main Human Phenotype Ontology file | ||
2. ``phenotype.hpoa`` The main annotation file with all HPO disease models | ||
3. ``Homo_sapiens_gene_info.gz`` A file from NCBI Entrez Gene with information about human genes | ||
4. ``mim2gene_medgen`` A file from the NCBI medgen project with OMIM-derived links between genes and diseases | ||
|
||
svann offers a convenience function to download all four files | ||
to a local directory. By default, svann will download all four files into a newly created subdirectory | ||
SvAnna offers a convenience function to download all four files | ||
to a local directory. By default, SvAnna will download all four files into a newly created subdirectory | ||
called ``data`` in the current working directory. You can change this default with the ``-d`` or ``--data`` options | ||
(If you change this, then you will need to pass the location of your directory to all other svann commands | ||
(If you change this, then you will need to pass the location of your directory to all other SvAnna commands | ||
using the ``-d`` flag). Download the files automatically as follows. :: | ||
|
||
$ java -jar svann.jar download | ||
$ java -jar svanna-cli.jar download | ||
|
||
svann will not download the files if they are already present unless the ``--overwrite`` argument is passed. For | ||
SvAnna will not download the files if they are already present unless the ``-f`` or ``--force-overwrite`` argument is passed. For | ||
instance, the following command would download the four files to a directory called datafiles and would | ||
overwrite any previously downloaded files. :: | ||
|
||
$ java -jar svann.jar download -d datafiles --overwrite | ||
$ java -jar svanna-cli.jar download -d datafiles --force-overwrite | ||
|
||
|
||
If desired, you can download these files on your own but you need to place them all in the | ||
same directory to run svann. | ||
same directory to run SvAnna. | ||
|
||
DGV: Database of Genomic Variants | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
SvAnna is being extended to filter variants for overlap with population variants. For now, SvAnna uses a downloaded | ||
file from the DGV (http://dgv.tcag.ca/dgv/app/downloads). Choose the file for the correct genome assembly (probably hg38), and | ||
download it. We then need to index this file with `tabix <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3042176/>`_. | ||
Assuming we have downloaded the file ``GRCh38_hg38_variants_2020-02-25.txt`` from DGV, proceed with the following steps :: | ||
|
||
$ bgzip GRCh38_hg38_variants_2020-02-25.txt | ||
$ tabix --skip-lines 1 -s 2 -b 3 -e 4 GRCh38_hg38_variants_2020-02-25.txt.gz | ||
|
||
After running the commands, the DGV file is compressed and indexed for quick random access. | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. _rstsv: | ||
|
||
Structural variation | ||
#################### | ||
|
||
Structural variation (SV) is generally defined as a region of DNA approximately 1 kb and larger in size | ||
(`Freeman et al., 2006 <https://pubmed.ncbi.nlm.nih.gov/16809666/>`_). SV includes | ||
inversions and balanced translocations or genomic imbalances (insertions and deletions), | ||
often referred to as copy number variants (CNVs). | ||
|
||
svanna is intended to be used to annotate and interpret VCF files representing the results of | ||
long-read genome sequencing using approaches for calling SVs. Currently, svanna supports the | ||
following types of SV. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
deletion | ||
|
||
|
||
|
Oops, something went wrong.