Skip to content

Commit 1b6e167

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 0e82a37 + 439284f commit 1b6e167

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2045
-1353
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ build/
3030
/web/jnlp.template
3131
/batik-codec.jar
3232
/goby-io-igv.jar
33-
/launcher/dist
33+
/launcher/dist
34+
/test/largedata
35+
36+
#Ignore index files
37+
*.*.idx
38+
!isect_res.bed.idx

src/org/broad/igv/PreferenceManager.java

+29-4
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616

1717

1818
import org.apache.log4j.Logger;
19+
import org.broad.igv.feature.genome.GenomeListItem;
1920
import org.broad.igv.maf.MAFManager;
2021
import org.broad.igv.renderer.ColorScaleFactory;
2122
import org.broad.igv.renderer.ContinuousColorScale;
23+
import org.broad.igv.sam.AlignmentTrack.ShadeBasesOption;
2224
import org.broad.igv.track.TrackType;
2325
import org.broad.igv.ui.AboutDialog;
2426
import org.broad.igv.ui.UIConstants;
2527
import org.broad.igv.ui.color.ColorUtilities;
2628
import org.broad.igv.ui.color.PaletteColorTable;
2729
import org.broad.igv.ui.util.PropertyManager;
2830
import org.broad.igv.util.HttpUtils;
29-
import org.broad.igv.sam.AlignmentTrack.ShadeBasesOption;
3031

3132
import java.awt.*;
3233
import java.io.File;
@@ -58,13 +59,15 @@ public class PreferenceManager implements PropertyManager {
5859
public static final String CHART_AUTOSCALE = "CHART.AUTOSCALE";
5960
public static final String CHART_SHOW_DATA_RANGE = "CHART.SHOW_DATA_RANGE";
6061

61-
/** Added by Chantal Roth, June 25th 2012 */
62+
/**
63+
* Added by Chantal Roth, June 25th 2012
64+
*/
6265
public static final String IONTORRENT_FLOWDIST_HIDE_FIRST_HP = "IONTORRENT.FLOWDIST_HIDE_FIRST_HP";
6366
public static final String IONTORRENT_FLOWDIST_BINSIZE = "IONTORRENT.FLOWDIST_BINSIZE";
6467
public static final String IONTORRENT_FLOWDIST_CHARTTYPE = "IONTORRENT.FLOWDIST_CHARTTYPE";
6568
public static final String IONTORRENT_SERVER = "IONTORRENT.SERVER";
6669
public static final String IONTORRENT_RESULTS = "IONTORRENT.RESULTS";
67-
70+
6871
public static final String SAM_ALLELE_THRESHOLD = "SAM.ALLELE_THRESHOLD";
6972
public static final String SAM_QUALITY_THRESHOLD = "SAM.QUALITY_THRESHOLD";
7073
public static final String SAM_MAX_INSERT_SIZE_THRESHOLD = "SAM.INSERT_SIZE_THRESHOLD";
@@ -131,6 +134,8 @@ public class PreferenceManager implements PropertyManager {
131134
final static public String LAST_SESSION_DIRECTORY = "LAST_SESSION_DIRECTORY";
132135
final static public String DEFAULT_GENOME_KEY = "DEFAULT_GENOME_KEY";
133136
final static public String LAST_CHROMOSOME_VIEWED_KEY = "LAST_CHROMOSOME_VIEWED_KEY";
137+
final static public String HISTORY_DELIMITER = ";";
138+
final static public String GENOME_HISTORY_KEY = "GENOME_HISTORY";
134139

135140
final public static String MUTATION_COLOR_TABLE = "MUTATION_COLOR_TABLE";
136141
final public static String MUTATION_INDEL_COLOR_KEY = "MUTATION_INDEL_COLOR_KEY";
@@ -944,7 +949,7 @@ private void initDefaultValues() {
944949
defaultValues.put(IONTORRENT_FLOWDIST_CHARTTYPE, "LINE");
945950
defaultValues.put(IONTORRENT_SERVER, "ioneast.ite");
946951
defaultValues.put(IONTORRENT_RESULTS, "/results/analysis/output/Home/");
947-
952+
948953
defaultValues.put(CHART_DRAW_TOP_BORDER, "false");
949954
defaultValues.put(CHART_DRAW_BOTTOM_BORDER, "false");
950955
defaultValues.put(CHART_COLOR_BORDERS, "true");
@@ -1088,4 +1093,24 @@ public void setPrefsFile(String s) {
10881093
}
10891094
}
10901095

1096+
public void saveGenomeHistory(List<GenomeListItem> serverGenomeItemList) {
1097+
String genomeString = "";
1098+
1099+
for (GenomeListItem serverItem : serverGenomeItemList) {
1100+
genomeString += serverItem.getId() + HISTORY_DELIMITER;
1101+
}
1102+
1103+
genomeString = genomeString.substring(0, genomeString.length() - 1);
1104+
preferences.put(GENOME_HISTORY_KEY, genomeString);
1105+
}
1106+
1107+
public String[] getGenomeHistory() {
1108+
String genomeIds = get(GENOME_HISTORY_KEY);
1109+
if (genomeIds == null) {
1110+
return new String[0];
1111+
} else {
1112+
return genomeIds.split(HISTORY_DELIMITER);
1113+
}
1114+
1115+
}
10911116
}

src/org/broad/igv/batch/CommandExecutor.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,15 @@ private String genome(String param1) {
271271
if (param1 == null) {
272272
return "ERROR missing genome parameter";
273273
}
274-
String result;
274+
String result = "OK";
275275
String genomeID = param1;
276276

277-
if (igv.getGenomeIds().contains(genomeID)) {
277+
if (igv.getSelectableGenomeIDs().contains(genomeID)) {
278278
igv.selectGenomeFromList(genomeID);
279279
} else {
280280
String genomePath = genomeID;
281281
if (!ParsingUtils.pathExists(genomePath)) {
282-
String workingDirectory = (new File("tmp")).getParent();
282+
String workingDirectory = System.getProperty("user.dir", "");
283283
genomePath = FileUtils.getAbsolutePath(genomeID, workingDirectory);
284284
}
285285
if (ParsingUtils.pathExists(genomePath)) {
@@ -289,11 +289,11 @@ private String genome(String param1) {
289289
throw new RuntimeException("Error loading genome: " + genomeID);
290290
}
291291
} else {
292-
MessageUtils.showMessage("Warning: Could not locate genome: " + genomeID);
292+
result = "ERROR: Could not locate genome: " + genomeID;
293+
MessageUtils.showMessage(result);
293294
}
294295
}
295296

296-
result = "OK";
297297
return result;
298298
}
299299

src/org/broad/igv/data/Interval.java

+21-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Interface used to represent data which spans an interval,
1919
* including the zoom level. If data is different for different
2020
* zoom levels, merging may not be possible
21-
*
21+
* <p/>
2222
* User: jacob
2323
* Date: 2012-Jul-05
2424
*/
@@ -27,35 +27,47 @@ public interface Interval extends Feature {
2727
/**
2828
* Determine whether this interval fully contains the specified
2929
* input interval
30+
*
3031
* @param chr
3132
* @param start
3233
* @param end
3334
* @param zoom
3435
* @return
3536
*/
36-
public boolean contains(String chr, int start, int end, int zoom);
37+
boolean contains(String chr, int start, int end, int zoom);
3738

3839
/**
3940
* Determine whether this interval overlaps the specified
4041
* interval at all
42+
*
4143
* @param chr
4244
* @param start
4345
* @param end
4446
* @param zoom
4547
* @return
4648
*/
47-
public boolean overlaps(String chr, int start, int end, int zoom);
49+
boolean overlaps(String chr, int start, int end, int zoom);
4850

4951

5052
/**
5153
* Merge another interval with this one
54+
*
5255
* @param i
5356
* @return True if the interval was merged, false
54-
* if not. Cannot necessarily merge an interval if there
55-
* is no overlap; if the Interval contains data
56-
* that data would be missing
57+
* if not. Cannot necessarily merge an interval if there
58+
* is no overlap; if the Interval contains data
59+
* that data would be missing
5760
*/
58-
public boolean merge(Interval i);
61+
boolean merge(Interval i);
62+
63+
64+
/**
65+
* Whether the provided interval can be merged with this one
66+
*
67+
* @param addingInterval
68+
* @return
69+
*/
70+
boolean canMerge(Interval addingInterval);
5971

6072
/**
6173
* Remove data outside the specified interval.
@@ -69,5 +81,6 @@ public interface Interval extends Feature {
6981
*/
7082
boolean trimTo(final String chr, final int start, final int end, int zoom);
7183

72-
public int getZoom();
84+
int getZoom();
85+
7386
}

src/org/broad/igv/data/WiggleParser.java

+11-18
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
/*
2-
* Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved.
2+
* Copyright (c) 2007-2012 The Broad Institute, Inc.
3+
* SOFTWARE COPYRIGHT NOTICE
4+
* This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.
5+
*
6+
* This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.
37
*
48
* This software is licensed under the terms of the GNU Lesser General Public License (LGPL),
59
* Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.
6-
*
7-
* THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR
8-
* WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING,
9-
* WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
10-
* PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER
11-
* OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE
12-
* TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES
13-
* OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
14-
* ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER
15-
* THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT
16-
* SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING.
1710
*/
1811
package org.broad.igv.data;
1912

20-
import org.broad.igv.Globals;
21-
import org.broad.igv.feature.genome.Genome;
22-
import org.broad.igv.track.TrackType;
23-
import org.broad.igv.util.collections.FloatArrayList;
24-
import org.broad.igv.util.collections.IntArrayList;
2513
import org.apache.log4j.Logger;
14+
import org.broad.igv.Globals;
2615
import org.broad.igv.exceptions.ParserException;
16+
import org.broad.igv.feature.genome.Genome;
2717
import org.broad.igv.track.TrackProperties;
18+
import org.broad.igv.track.TrackType;
2819
import org.broad.igv.util.ParsingUtils;
2920
import org.broad.igv.util.ResourceLocator;
21+
import org.broad.igv.util.collections.FloatArrayList;
22+
import org.broad.igv.util.collections.IntArrayList;
3023
import org.broad.tribble.readers.AsciiLineReader;
3124

3225
import java.util.HashMap;
@@ -143,7 +136,7 @@ public WiggleDataset parse() {
143136
try {
144137
reader = ParsingUtils.openAsciiReader(resourceLocator);
145138

146-
if (type == type.EXPR) {
139+
if (type == Type.EXPR) {
147140
reader.readLine(); // Skip header line
148141
}
149142

src/org/broad/igv/data/seg/SegmentedAsciiDataSet.java

+6-23
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
/*
2-
* Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved.
2+
* Copyright (c) 2007-2012 The Broad Institute, Inc.
3+
* SOFTWARE COPYRIGHT NOTICE
4+
* This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.
5+
*
6+
* This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.
37
*
48
* This software is licensed under the terms of the GNU Lesser General Public License (LGPL),
59
* Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.
6-
*
7-
* THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR
8-
* WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING,
9-
* WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
10-
* PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER
11-
* OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE
12-
* TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES
13-
* OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
14-
* ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER
15-
* THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT
16-
* SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING.
1710
*/
1811

1912
/*
@@ -141,16 +134,6 @@ public List<LocusScore> getSegments(String heading, String chr) {
141134
return (chrSegments == null) ? null : chrSegments.get(chr);
142135
}
143136

144-
/**
145-
* Method description
146-
*
147-
* @return
148-
*/
149-
public List<String> getDataHeadings() {
150-
return headings;
151-
}
152-
153-
154137
public List<String> getSampleNames() {
155138
return headings;
156139
}
@@ -261,7 +244,7 @@ public void setTrackProperties(TrackProperties props) {
261244
}
262245

263246
public TrackProperties getTrackProperties() {
264-
if(trackProperties == null) {
247+
if (trackProperties == null) {
265248
trackProperties = new TrackProperties();
266249
}
267250
return trackProperties;

src/org/broad/igv/dev/db/database.dtd

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<!--
2+
~ Copyright (c) 2007-2012 The Broad Institute, Inc.
3+
~ SOFTWARE COPYRIGHT NOTICE
4+
~ This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.
5+
~
6+
~ This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.
7+
~
8+
~ This software is licensed under the terms of the GNU Lesser General Public License (LGPL),
9+
~ Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.
10+
-->
11+
12+
<!-- Profile describing how to load data from a SQL database-->
13+
14+
<!-- A database element describes a connection to a single database.
15+
This includes separate path elements (host, path, port).
16+
17+
version
18+
Version of the descriptive file, not the database. Used to ensure
19+
compatibility with future versions
20+
name
21+
Human-readable name of database
22+
description
23+
Human-readable description
24+
-->
25+
<!ELEMENT database (table+)>
26+
<!ATTLIST database
27+
version (alpha) #REQUIRED
28+
host CDATA #REQUIRED
29+
path CDATA #REQUIRED
30+
port CDATA #REQUIRED
31+
subprotocol CDATA #REQUIRED
32+
username CDATA #REQUIRED
33+
name CDATA #REQUIRED
34+
description CDATA #IMPLIED>
35+
36+
37+
<!--
38+
A database can have any number of tables within it.
39+
For each table, we have to specify the location
40+
of certain columns.
41+
name
42+
Exact name of the table
43+
description
44+
Human-readable description of data
45+
binColName
46+
For efficient lookups, many databases use an r-tree,
47+
and store the bin number. See
48+
http://genomewiki.ucsc.edu/index.php/Bin_indexing_system
49+
for UCSC binning structure. If this column name is provided,
50+
we assume such column exists and it uses this binning structure.
51+
chromoColName
52+
Column name which stores chromosome names
53+
format
54+
Table must be in a format which IGV can read, that is,
55+
the rows must be in the same order/meaning as one
56+
of the file formats IGV can read. "format" is file extension
57+
that the table is similar to (e.g. bed, psl, ucscgene).
58+
We say "similar" because the startColIndex/endColIndex
59+
fields can be used to take a subset of columns
60+
posStartColName
61+
The name of the column which contains the start positions
62+
of each feature. Necessary for constructing queries.
63+
posEndColName
64+
Name of the column which contains end positions of each feature.
65+
startColIndex
66+
1-based Column index from which to start reading data. Default 1.
67+
endColIndex
68+
1-based column index, inclusive, at which to stop reading data.
69+
Default 2147483646 (Integer.MAX_VALUE - 1, ie all)
70+
71+
-->
72+
<!ELEMENT table (#PCDATA)>
73+
<!ATTLIST table
74+
name CDATA #REQUIRED
75+
description CDATA #IMPLIED
76+
binColName CDATA #IMPLIED
77+
chromoColName CDATA #REQUIRED
78+
format CDATA #REQUIRED
79+
posStartColName CDATA #REQUIRED
80+
posEndColName CDATA #REQUIRED
81+
startColIndex CDATA "1"
82+
endColIndex CDATA "2147483646">
83+

0 commit comments

Comments
 (0)