Skip to content

Commit

Permalink
Merge pull request #133 from TheJacksonLaboratory/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pnrobinson authored Dec 31, 2020
2 parents 0ed6dbf + 6717156 commit 2e88552
Show file tree
Hide file tree
Showing 309 changed files with 30,355 additions and 3,084 deletions.
22 changes: 15 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Compiled class file
target/
*.class

# Log file
Expand All @@ -11,6 +12,7 @@
.mtj.tmp/

# Package Files #
!maven-wrapper.jar
*.jar
*.war
*.nar
Expand All @@ -21,11 +23,17 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/vmvt-cli.iml
/l2o.iml
/data/
/l2o.html
/l2o.bed
/l2o.igv.txt

# IDE stuff
.idea/
*.iml

# Local data files
data/

# Local output files
*.html

# Sphinx documentation
docs/_build/
/dependency-reduced-pom.xml
/L2O.html
117 changes: 117 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
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();
}

}
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
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
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=========
Changelog
=========

------
v0.3.0
------
- Adding phenopacket support
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ This command downloads various files and generates `data/hg38_refseq_curated.ser
this to the data subdirectory in this project or softlink it (from 'data', enter `ln -s <path>`).
Thus, for now, this project expects the path `data/data/refseq_curated.ser`.

### LIRICAL
Run [LIRICAL](https://github.com/TheJacksonLaboratory/LIRICAL) using only the clinical manifestations
of the case, and output a TSV file. Consider using the
[PhenopacketGenerator](https://github.com/TheJacksonLaboratory/PhenopacketGenerator).

## Running svann

Enter the following command to see options. The LIRICAL file is the
Expand All @@ -42,21 +37,26 @@ it is required to also use an HPO term with the major phenotypic abnormality,
e.g., [Abnormality of the immune system](https://hpo.jax.org/app/browse/term/HP:0002715).

```
$ java -jar target/svann.jar
LIRICAL to overlapping SV
-h, --help Show this help message and exit.
-l, --lirical=<liricalFile>
-o, --out=<outname>
-v, --vcf=<vcfFile>
-V, --version Print version information and exit.
$ java -jar target/svann.jar annotate -h
Usage: svann annotate [-hV] [-e=<enhancerFile>] [-g=<geneCodePath>]
[-j=<jannovarPath>] [-t=<hpoTermIdList>] -v=<vcfFile>
[-x=<outprefix>]
annotate VCF file
-e, --enhancer=<enhancerFile>
tspec enhancer file
-g, --gencode=<geneCodePath>
-h, --help Show this help message and exit.
-j, --jannovar=<jannovarPath>
prefix for output files (default:
data/data/hg38_refseq_curated.ser )
-t, --term=<hpoTermIdList> HPO term IDs (comma-separated list)
-v, --vcf=<vcfFile>
-V, --version Print version information and exit.
-x, --prefix=<outprefix> prefix for output files (default: L2O )
```


We can run l2o to look for specific enhancer overlaps, e.g., for terms with
[Abnormal T cell morphology - HP:0002843](https://hpo.jax.org/app/browse/term/HP:0002843).



# Documentation
Expand Down
17 changes: 17 additions & 0 deletions docs/deletion.rst
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

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ of germline variants.
setup
running
BND<bndannotations>

structuralvariation

17 changes: 17 additions & 0 deletions docs/running.rst
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...
61 changes: 36 additions & 25 deletions docs/setup.rst
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.


22 changes: 22 additions & 0 deletions docs/structuralvariation.rst
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



Loading

0 comments on commit 2e88552

Please sign in to comment.