Skip to content

Commit fe092ee

Browse files
committed
Merge branch 'master' of github.com:biojava/biojava
# Conflicts: # biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java
2 parents 9f98ae6 + 55926e2 commit fe092ee

File tree

8 files changed

+565
-215
lines changed

8 files changed

+565
-215
lines changed

CHANGELOG

Lines changed: 0 additions & 4 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
BioJava 5.0.0
2+
=============
3+
4+
unreleased
5+
6+
- For short structure selections (e.g. 1abc.A:1-100), ligands within 5A will be included
7+
8+
9+
BioJava 4.2.5
10+
=============
11+
12+
release date: December 7th 2016
13+
This release contains [30](https://github.com/biojava/biojava/compare/biojava-4.2.4...biojava-4.2.5) commits from 7 contributors.
14+
15+
### Bug fixes
16+
17+
* Fix for new phosphositeplus.org format, #610
18+
* org.biojava.nbio.genome.parsers.gff.Location union() and intersect() now work correctly, #355
19+
* Minor addition of crystallographic metadata fields to handle legacy PDB entries
20+
* Jmol interchange format is now mmCIF, allowing for multiletter chain ids
21+
* Update to latest jmol 14.6.2_2016.08.28
22+
* A few minor bug fixes
23+
24+
BioJava 4.2.4
25+
=============
26+
27+
release date: July 29th 2016
28+
This release contains over [17](https://github.com/biojava/biojava/compare/biojava-4.2.3...biojava-4.2.4) commits from 4 contributors.
29+
30+
### Bug fixes
31+
32+
* NCBI links now using https (see [NCBI's announcement](http://www.ncbi.nlm.nih.gov/news/06-10-2016-ncbi-https/) )
33+
* CATH links redirected to new server http://release.cathdb.info/
34+
* SCOP default location now points to the Berkeley server after demise of Scop at MRC LMB
35+
* Fixed important bug in mmCIF writing where structures with multiple models were written with identical coordinates
36+
* Fixed bug in Group cloning where chemical components weren't cloned
37+
* Added utility class for Chromosome mapping
38+
39+
BioJava 4.2.3
40+
=============
41+
42+
release date: July 28th 2016
43+
This release contains over [13](https://github.com/biojava/biojava/compare/biojava-4.2.2...biojava-4.2.3) commits from 2 contributors.
44+
45+
### Bug fixes
46+
47+
* mmCIF file writing: special fields (e.g. containing hyphens) are now correctly written
48+
* General improvements in mmCIF file read and write
49+
50+
BioJava 4.2.2
51+
=============
52+
53+
release date: June 14th 2016
54+
This release contains over [31](https://github.com/biojava/biojava/compare/biojava-4.2.1...biojava-4.2.2) commits from 5 contributors.
55+
56+
### Bug fixes
57+
58+
This is a bug-fix release
59+
60+
* CE-Symm features and bug fixes
61+
- Better data structures for symmetry axes (particularly for hierarchical symmetry)
62+
- Fix bug with symmetry axis positioning
63+
- Optimization includes all symmetry repeats for hierarchical symmetry
64+
* Update of protein modifications to latest version,
65+
- including new glycans and chromophores
66+
- Updating naming definitions to latest conventions
67+
68+
69+
BioJava 4.2.1
70+
=============
71+
72+
release date: May 3rd 2016
73+
This release contains over [31](https://github.com/biojava/biojava/compare/biojava-4.2.0...biojava-4.2.1) commits from 7 contributors.
74+
75+
### Bug fixes
76+
77+
Biojava-structure
78+
79+
- Nucleotide bonds are now generated
80+
- BIO: identifiers are now correctly handled
81+
- Several fixes for CE-Symm
82+
- Substructures now contain seqres groups (isse #449)
83+
- Structures containing insertion codes are now written correctly to mmCIF
84+
- AtomCache now uses the correct default parsing parameters (issue #455)
85+
- Fixed problem with some atom charges that weren't being added
86+
- CATH updated to 4.0.0
87+
- Better ECOD javadocs (issue #452)
88+
89+
Biojava-structure-gui
90+
- Removed javaws dependency (issue #459)
91+
92+
BioJava 4.2.0
93+
=============
94+
95+
release date: March 10th 2016
96+
97+
This release contains over [750](https://github.com/biojava/biojava/compare/6f8d796fee92edbbcd001c33cdae4f15c5480741...biojava-4.2.0) commits from 16 contributors.
98+
99+
### New Features
100+
101+
BioJava 4.2.0 offers many new features, as well several bug-fixes.
102+
103+
General
104+
105+
- Requires Java 7
106+
- Better logging with SLF4J
107+
108+
Biojava-Core
109+
110+
- New SearchIO framework including blast xml parser
111+
112+
Biojava-structure
113+
114+
- Secondary structure assignment (DSSP compatible)
115+
- Multiple Structure Alignments
116+
- New MultipleStructureAlignment datastructure supporting flexible and order-independent alignments
117+
- MultipleMC algorithm
118+
- Can use any pairwise StructureAlignment implementation
119+
- serialize and parse multiple structure alignments as XML files, output as Text, FatCat, FASTA, Rotation Matrices, etc.
120+
- More complete mmCIF and cif parsing
121+
- Parse bonds, sites, charges
122+
- Better support for non-deposited pdb and mmcif files
123+
- Include CE-Symm algorithm for finding internal symmetry (Myers-Turnbull, 2014)
124+
- Replaced internal graph datastructures with Jgraph
125+
- Unified StructureIdentifier framework
126+
- Improved chemical component framework, now by default providing full chemical description by using DownloadChemCompProvider
127+
- Optimised memory usage of Residue/Atoms
128+
129+
Biojava-structure-gui
130+
131+
- MultipleAlignmentGUI for visualizing Multiple Structure Alignments with Jmol
132+
- SymmetryDisplay for visualizing internal symmetry
133+
134+
Biojava-Phylo
135+
136+
- Use Forester 1.038
137+
- Significant bug fixes
138+
- use SubstitutionMatrices in the core module (instead of imported Jalview matrices),
139+
- use Sequence and Compound classes from the alignment module
140+
- provide some Wrapper methods to communicate with forester,
141+
- decouple distance matrix calculation from tree constructor,
142+
- provide methods for common distance matrix calculations and framework for user-defined distances,
143+
- update the forester version to have the correct NJ tree constructor
144+
AND
145+
- correct some of the tree evaluator statistics.
146+
147+
148+
149+
150+
151+
152+
153+
154+

biojava-modfinder/src/main/java/org/biojava/nbio/phosphosite/Dataset.java

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121
package org.biojava.nbio.phosphosite;
2222

2323
import org.biojava.nbio.structure.align.util.AtomCache;
24+
import org.slf4j.Logger;
25+
import org.slf4j.LoggerFactory;
2426

2527
import java.io.*;
2628
import java.net.URL;
2729
import java.nio.channels.FileChannel;
30+
import java.nio.file.Files;
31+
import java.nio.file.StandardCopyOption;
2832
import java.util.ArrayList;
2933
import java.util.List;
3034

@@ -43,6 +47,7 @@
4347
*/
4448
public class Dataset {
4549

50+
private static final Logger logger = LoggerFactory.getLogger(Dataset.class);
4651

4752
public static final String ACETYLATION = "http://www.phosphosite.org/downloads/Acetylation_site_dataset.gz";
4853

@@ -110,8 +115,8 @@ public File getLocalDir(){
110115

111116
public void download(){
112117

113-
System.out.println("Downloading data from www.phosposite.org. Data is under CC-BY-NC-SA license. Please link to site and cite: ");
114-
System.out.println("Hornbeck PV, Kornhauser JM, Tkachev S, Zhang B, Skrzypek E, Murray B, Latham V, Sullivan M (2012) PhosphoSitePlus: a comprehensive resource for investigating the structure and function of experimentally determined post-translational modifications in man and mouse. Nucleic Acids Res. 40(Database issue), D261–70.");
118+
logger.warn("Downloading data from www.phosposite.org. Data is under CC-BY-NC-SA license. Please link to site and cite: ");
119+
logger.warn("Hornbeck PV, Kornhauser JM, Tkachev S, Zhang B, Skrzypek E, Murray B, Latham V, Sullivan M (2012) PhosphoSitePlus: a comprehensive resource for investigating the structure and function of experimentally determined post-translational modifications in man and mouse. Nucleic Acids Res. 40(Database issue), D261–70.");
115120

116121
File dir = getLocalDir();
117122

@@ -154,9 +159,9 @@ public void download(){
154159

155160
}
156161

157-
private void downloadFile(URL u, File localFile) throws IOException {
162+
public void downloadFile(URL u, File localFile) throws IOException {
158163

159-
System.out.println("Downloading " + u);
164+
logger.info("Downloading " + u);
160165

161166
File tmp = File.createTempFile("tmp","phosphosite");
162167

@@ -185,37 +190,8 @@ private void downloadFile(URL u, File localFile) throws IOException {
185190
public static void copyFile(File src, File dst) throws IOException
186191
{
187192

188-
// TODO: upgrade to Java 7:
193+
Files.copy(src.toPath(), dst.toPath(), StandardCopyOption.REPLACE_EXISTING);
189194

190-
// Files.copy(src.toPath(), dst.toPath(), StandardCopyOption.REPLACE_EXISTING);
191-
192-
193-
194-
long p = 0, dp, size;
195-
FileChannel in = null, out = null;
196-
197-
try
198-
{
199-
if (!dst.exists()) dst.createNewFile();
200-
201-
in = new FileInputStream(src).getChannel();
202-
out = new FileOutputStream(dst).getChannel();
203-
size = in.size();
204-
205-
while ((dp = out.transferFrom(in, p, size)) > 0)
206-
{
207-
p += dp;
208-
}
209-
}
210-
finally {
211-
try
212-
{
213-
if (out != null) out.close();
214-
}
215-
finally {
216-
if (in != null) in.close();
217-
}
218-
}
219195
}
220196

221197

@@ -227,16 +203,16 @@ public static void main(String[] args) {
227203

228204
try {
229205

230-
231206
for (File f : ds.getLocalFiles()) {
232207

233-
System.out.println(f.getAbsoluteFile());
208+
logger.info(f.getAbsolutePath());
234209

235210
List<Site> sites = Site.parseSites(f);
236211

212+
logger.info("Got " + sites.size() + " sites");
237213
for (Site s : sites) {
238214
if (s.getUniprot().equals("P50225") || s.getUniprot().equals("P48025")) {
239-
System.out.println(s);
215+
logger.info(s.toString());
240216
}
241217
}
242218

biojava-modfinder/src/main/java/org/biojava/nbio/phosphosite/Site.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,26 @@ public static List<Site> parseSites(File f) throws IOException {
5656

5757
int proteinIndex = -1;
5858
int uniprotIndex = -1;
59-
int modTypeIndex = -1;
6059
int residueIndex = -1;
6160
int orgIndex = -1;
6261
int groupIndex = -1;
62+
int geneIndex = -1;
6363

6464
boolean inHeader = true;
6565

6666

6767
while ((line = buf.readLine()) != null){
68-
if ( line.startsWith("PROTEIN")) {
68+
if ( line.startsWith("GENE") ||
69+
line.startsWith("PROTEIN")) {
6970

7071
headerFields = parseHeaderFields(line);
7172

7273
proteinIndex = headerFields.indexOf("PROTEIN");
7374
uniprotIndex = headerFields.indexOf("ACC_ID");
74-
modTypeIndex = headerFields.indexOf("MOD_TYPE");
7575
residueIndex = headerFields.indexOf("MOD_RSD");
76-
orgIndex = headerFields.indexOf("ORG");
76+
orgIndex = headerFields.indexOf("ORGANISM");
7777
groupIndex = headerFields.indexOf("SITE_GRP_ID");
78+
geneIndex = headerFields.indexOf("GENE");
7879

7980
inHeader = false;
8081
continue;
@@ -95,19 +96,25 @@ public static List<Site> parseSites(File f) throws IOException {
9596

9697
String protein = spl[proteinIndex];
9798
String uniprot = spl[uniprotIndex];
98-
//String geneSymb = spl[2];
99-
//String chrLoc = spl[3];
100-
String modType = spl[modTypeIndex];
99+
101100
String residue = spl[residueIndex];
101+
102+
String[] resSpl = residue.split("-");
103+
String modType = null;
104+
if ( resSpl.length == 2) {
105+
106+
modType = resSpl[1];
107+
}
102108
String group = spl[groupIndex];
103109

104110
String organism = spl[orgIndex];
105111

112+
String geneSymb = spl[geneIndex];
113+
106114
Site s = new Site();
107115
s.setProtein(protein);
108116
s.setUniprot(uniprot);
109-
//s.setGeneSymb(geneSymb);
110-
//s.setChrLoc(chrLoc);
117+
s.setGeneSymb(geneSymb);
111118
s.setModType(modType);
112119
s.setResidue(residue);
113120
s.setGroup(group);

biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import static org.junit.Assert.assertTrue;
1515
import static org.junit.Assert.fail;
1616

17-
/** Makes sure there is a local installation of the Acetyaltion site file from Phosphosite and
17+
18+
/** Makes sure there is a local installation of the Acetylation site file from Phosphosite and
1819
* tests if it can get parsed by the parser.
1920
*
2021
* Created by andreas on 11/29/16.
@@ -27,21 +28,18 @@ public class TestAcetylation {
2728
*
2829
*/
2930
@Before
30-
public void setUp(){
31+
public void setUp() throws IOException{
3132

3233
Dataset ds = new Dataset();
3334

3435
String f = Dataset.ACETYLATION;
3536

3637
File localFile = getLocalFileName(f);
3738

38-
try {
39-
if (!localFile.exists()) {
40-
ds.downloadFile(new URL(f), localFile);
41-
}
42-
} catch (IOException e) {
43-
e.printStackTrace();
39+
if (!localFile.exists()) {
40+
ds.downloadFile(new URL(f), localFile);
4441
}
42+
4543
}
4644

4745
/** returns the local file name where the Acetylation file will get cached locally.
@@ -70,26 +68,19 @@ private File getLocalFileName(String phosphoSiteFileLocation){
7068
*
7169
*/
7270
@Test
73-
public void testAcetylation() {
74-
75-
try {
71+
public void testAcetylation() throws IOException {
7672

77-
File localFile = getLocalFileName(Dataset.ACETYLATION);
73+
File localFile = getLocalFileName(Dataset.ACETYLATION);
7874

79-
List<Site> sites = Site.parseSites(localFile);
75+
List<Site> sites = Site.parseSites(localFile);
8076

81-
assertTrue(sites.size() > 0);
77+
assertTrue(sites.size() > 0);
8278

83-
for (Site s : sites) {
79+
for (Site s : sites) {
8480

85-
assertTrue(s.getResidue() != null);
81+
assertTrue(s.getResidue() != null);
8682

87-
}
88-
89-
90-
} catch (Exception e) {
91-
e.printStackTrace();
92-
fail(e.getMessage());
9383
}
84+
9485
}
9586
}

0 commit comments

Comments
 (0)