Skip to content

Commit b818d09

Browse files
committed
Merge branch 'dev' into gzip-support
2 parents e4d3490 + 7cbfeed commit b818d09

File tree

260 files changed

+5095
-734
lines changed

Some content is hidden

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

260 files changed

+5095
-734
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
3030
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
3131
<classpathentry kind="output" path="bin/default"/>
32-
</classpath>
32+
</classpath>

.github/workflows/gradle.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ jobs:
3838
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
3939
with:
4040
arguments: build
41-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
/.gradle/
44
/build/
55
.metadata
6-
.idea
6+
.idea

.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
<nature>org.eclipse.jdt.core.javanature</nature>
2121
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
2222
</natures>
23-
</projectDescription>
23+
</projectDescription>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
connection.project.dir=
2-
eclipse.preferences.version=1
2+
eclipse.preferences.version=1

docusaurus/docs/Guides/command-line.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ refer the user to the appropriate tool.
6868
| | [scaling-factor](https://github.com/CEGRcode/scriptmanager/wiki/Read-Analysis#scaling-factor) |
6969
| | [similarity-matrix](https://github.com/CEGRcode/scriptmanager/wiki/Read-Analysis#similarity-matrix-suspended) |
7070
| | [tag-pileup](https://github.com/CEGRcode/scriptmanager/wiki/Read-Analysis#tag-pileup) |
71+
| | [transpose-matrix](https://github.com/CEGRcode/scriptmanager/wiki/Read-Analysis#transpose-matrix) |
7172
| **seq-analysis** | [dna-shape-bed](https://github.com/CEGRcode/scriptmanager/wiki/Sequence-Analysis#dna-shape-bed) |
7273
| | [dna-shape-fasta](https://github.com/CEGRcode/scriptmanager/wiki/Sequence-Analysis#dna-shape-fasta) |
7374
| | [fasta-extract](https://github.com/CEGRcode/scriptmanager/wiki/Sequence-Analysis#fasta-extract) |

docusaurus/docs/Guides/tool-group.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Others manipulate files to calculate normalization factors, normalize the data,
108108
| [`scaling-factor`][scaling-factor] | [BAM][bam-format] | [TXT][txt-format] | Calculate the factor as either total tag normalization or normalization of ChIP-seq data with control. (PMID:22883957) |
109109
| [`scale-matrix`][scale-matrix] | \[[CDT][cdt-format]\|[TAB][mat-format]\] | [TAB][mat-format]\[..\] | Apply a user-specified scaling factor to tab-delimited matrix data. |
110110
| [`aggregate-data`][aggregate-data] | \[[CDT][cdt-format]\|[TAB][mat-format]\]\[..\] | [TAB][mat-format]\[..\] | The AggregateData tool is used to process a bunch of matrix files into one matrix file. |
111-
111+
| [`transpose-matrix`][scale-matrix] | \[[CDT][cdt-format]\|[TAB][mat-format]\] | \[[CDT][cdt-format]\|[TAB][mat-format]\] | Interchange the rows and columns of a matrix |
112112

113113
## Sequence Analysis
114114

@@ -165,6 +165,7 @@ _Sequence Analysis tools description_
165165
[scaling-factor]:read-analysis/scaling-factor.md
166166
[similarity-matrix]:read-analysis/similarity-matrix.md
167167
[tag-pileup]:read-analysis/tag-pileup.md
168+
[transpose-matrix]:read-analysis/transpose-matrix.md
168169

169170
[dna-shape-bed]:sequence-analysis/dna-shape-bed.md
170171
[dna-shape-fasta]:sequence-analysis/dna-shape-fasta.md

docusaurus/docs/References/toolIndex.table.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ export const toolIndex = [
268268
command: "-",
269269
url: "docs/peak-analysis/tile-genome",
270270
},
271+
{
272+
name: "Transpose Matrix",
273+
group: "RA",
274+
description: "Interchange the rows and columns of a matrix.",
275+
command: "-",
276+
url: "docs/read-analysis/transpose-matrix",
277+
},
271278
];
272279

273280

docusaurus/docs/file-formats.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Related Tools:
120120
| [`heatmap`][heatmap] | |
121121
| | [`peak-align-ref`][peak-align-ref] |
122122
| [`scale-matrix`][scale-matrix] | [`scale-matrix`][scale-matrix] |
123+
| [`transpose-matrix`][transpose-matrix] | [`transpose-matrix`][transpose-matrix] |
123124
| [`sort-bed`][sort-bed] | |
124125
| | [`tag-pileup`][tag-pileup] |
125126

@@ -203,6 +204,7 @@ Related Tools:
203204
[`randomize-fasta`][randomize-fasta]
204205
[`remove-duplicates`][remove-duplicates]
205206
[`scale-matrix`][scale-matrix]
207+
[`transpose-matrix`][transpose-matrix]
206208
[`scaling-factor`][scaling-factor]
207209
[`se-stat`][se-stat]
208210
[`search-motif`][search-motif]
@@ -256,6 +258,7 @@ Related Tools:
256258
[randomize-fasta]:sequence-analysis/randomize-fasta
257259
[remove-duplicates]:bam-manipulation/remove-duplicates
258260
[scale-matrix]:read-analysis/scale-matrix
261+
[transpose-matrix]:read-analysis/transpose-matrix
259262
[scaling-factor]:read-analysis/scaling-factor
260263
[se-stat]:bam-statistics/se-stat
261264
[search-motif]:sequence-analysis/search-motif

docusaurus/docs/read-analysis/scale-matrix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This tool takes a single matrix file for input.
4444

4545
| Option | Description |
4646
| ------ | ----------- |
47-
| `-r, --start-row` | |
48-
| `-l, --start-col` | |
47+
| `-r, --start-row` | row to start scaling the matrix (zero indexed) |
48+
| `-l, --start-col` | column to start scaling the matrix (zero indexed) |
4949

5050
[file-format]:file-formats.md
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
id: transpose-matrix
3+
title: Transpose Matrix
4+
sidebar_label: transpose-matrix
5+
---
6+
7+
![transpose-matrix](/../static/icons/Read_Analysis/TransposeMatrix_square.svg)
8+
9+
Interchange the rows and columns of a matrix, while optionally preserving labels.
10+
11+
<img src={require('/../static/md-img/Read_Analysis/TransposeMatrixWindow.png').default} style={{width:70+'%'}}/>
12+
13+
## Command Line Interface
14+
15+
Usage:
16+
```bash
17+
java -jar ScriptManager.jar read-analysis transpose-matrix [-hV] [-z] [-l=<startCOL>]
18+
[-o=<output>] [-r=<startROW>] <matrix>
19+
```
20+
21+
## Positional Input
22+
23+
This tool takes a single matrix file for input.
24+
25+
26+
### Output Options
27+
28+
| Option | Description |
29+
| ------ | ----------- |
30+
| `-o, --output=<output>` | specify output filename |
31+
| `-z, --compress` | output compressed .gz file |
32+
33+
34+
### Coord Start Options
35+
36+
| Option | Description |
37+
| ------ | ----------- |
38+
| `-r, --start-row` | row to start transposing the matrix (zero indexed) |
39+
| `-l, --start-col` | column to start transposing the matrix (zero indexed) |
40+
41+
[file-format]:file-formats.md

docusaurus/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ module.exports = {
5757
"read-analysis/scaling-factor",
5858
"read-analysis/scale-matrix",
5959
"read-analysis/aggregate-data",
60+
"read-analysis/transpose-matrix"
6061
],
6162
"Sequence Analysis": [
6263
"sequence-analysis/fasta-extract",

docusaurus/static/icons/Read_Analysis/TransposeMatrix_square.svg

Lines changed: 7 additions & 0 deletions
Loading
Loading

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,4 @@ eval "set -- $(
241241
tr '\n' ' '
242242
)" '"$@"'
243243

244-
exec "$JAVACMD" "$@"
244+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ exit /b %EXIT_CODE%
8989
:mainEnd
9090
if "%OS%"=="Windows_NT" endlocal
9191

92-
:omega
92+
:omega

src/main/java/scriptmanager/charts/CompositePlot.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
*/
2929
public class CompositePlot {
3030

31+
/**
32+
* Creates a new CompositePlot object
33+
*/
34+
public CompositePlot(){}
35+
3136
/**
3237
* Create a two-line plot (sense and antisense composites) with a title and
3338
* custom colors. There are no checks on input array lengths (line plot

src/main/java/scriptmanager/charts/Histogram.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Histogram {
3131
* @param y the list of frequencies
3232
* @param x the list of values that have frequencies (same len as y)
3333
* @return the bar-style histogram chart
34-
* @throws IOException
34+
* @throws IOException Invalid file or parameters
3535
*/
3636
public static ChartPanel createBarChart(double[] y, int[] x) throws IOException {
3737
final XYSeries series = new XYSeries("Frequency");
@@ -54,7 +54,7 @@ public static ChartPanel createBarChart(double[] y, int[] x) throws IOException
5454
* @param x the list of values that have frequencies (same len as y)
5555
* @param output the path of the PNG file to save the chart image to
5656
* @return the bar-style histogram chart
57-
* @throws IOException
57+
* @throws IOException Invalid file or parameters
5858
*/
5959
public static ChartPanel createBarChart(double[] y, int[] x, File output) throws IOException {
6060
final XYSeries series = new XYSeries("Frequency");
@@ -82,7 +82,7 @@ public static ChartPanel createBarChart(double[] y, int[] x, File output) throws
8282
*
8383
* @param dataset the formatted dataset to plot
8484
* @return the formatted and configured histogram chart
85-
* @throws IOException
85+
* @throws IOException Invalid file or parameters
8686
*/
8787
private static JFreeChart createChart(IntervalXYDataset dataset) throws IOException {
8888
final JFreeChart chart = ChartFactory.createXYBarChart(

src/main/java/scriptmanager/charts/LineChart.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class LineChart {
3131
* @param y the duplication rate values
3232
* @param x the domain values
3333
* @return the line plot chart
34-
* @throws IOException
34+
* @throws IOException Invalid file or parameters
3535
*/
3636
public static ChartPanel createLineChart(ArrayList<Double> y, String[] x) throws IOException {
3737
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
@@ -53,7 +53,7 @@ public static ChartPanel createLineChart(ArrayList<Double> y, String[] x) throws
5353
* @param y2 the genome duplication rate values
5454
* @param x the domain values
5555
* @return the line plot chart
56-
* @throws IOException
56+
* @throws IOException Invalid file or parameters
5757
*/
5858
public static ChartPanel createLineChart(ArrayList<Double> y1, ArrayList<Double> y2, String[] x) throws IOException {
5959
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
@@ -75,7 +75,7 @@ public static ChartPanel createLineChart(ArrayList<Double> y1, ArrayList<Double>
7575
* @param x the domain values
7676
* @param output the path of the PNG file to save the chart image to
7777
* @return the line plot chart
78-
* @throws IOException
78+
* @throws IOException Invalid file or parameters
7979
*/
8080
public static ChartPanel createLineChart(ArrayList<Double> y, String[] x, File output) throws IOException {
8181
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
@@ -102,7 +102,7 @@ public static ChartPanel createLineChart(ArrayList<Double> y, String[] x, File o
102102
*
103103
* @param dataset the formatted dataset to plot
104104
* @return the line plot chart
105-
* @throws IOException
105+
* @throws IOException Invalid file or parameters
106106
*/
107107
private static JFreeChart createChart(CategoryDataset dataset) throws IOException {
108108
final JFreeChart chart = ChartFactory.createLineChart(
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Collection of classes containing static methods to generate Components with a
3+
* variety of visualizations for data. Used by graphical interfaces
4+
* (`window_interface`) and figure making scripts in
5+
* {@link scriptmanager.scripts.BAM_Format_Converter}
6+
*/
7+
package scriptmanager.charts;

src/main/java/scriptmanager/cli/BAM_Format_Converter/BAMtoBEDCLI.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@
1515
import scriptmanager.scripts.BAM_Format_Converter.BAMtoBED;
1616

1717
/**
18-
BAM_Format_ConverterCLI/SEStatsCLI
19-
*/
18+
* Command line interface for
19+
* {@link scriptmanager.scripts.BAM_Format_Converter.BAMtoBED}
20+
*
21+
* @author Olivia Lang
22+
*/
2023
@Command(name = "bam-to-bed", mixinStandardHelpOptions = true,
2124
description = ToolDescriptions.bam_to_bed_description,
2225
version = "ScriptManager "+ ToolDescriptions.VERSION,
2326
sortOptions = false,
2427
exitCodeOnInvalidInput = 1,
2528
exitCodeOnExecutionException = 1)
2629
public class BAMtoBEDCLI implements Callable<Integer> {
30+
31+
/**
32+
* Creates a new BAMtoBEDCLI object
33+
*/
34+
public BAMtoBEDCLI(){}
2735

2836
@Parameters( index = "0", description = "The BAM file from which we generate a new file.")
2937
private File bamFile;
@@ -61,6 +69,10 @@ static class ReadType {
6169
private int STRAND = -9999;
6270
private int PAIR;
6371

72+
/**
73+
* Runs when this subcommand is called, running script in respective script package with user defined arguments
74+
* @throws IOException Invalid file type
75+
*/
6476
@Override
6577
public Integer call() throws Exception {
6678
System.err.println( ">BAMtoBEDCLI.call()" );
@@ -96,10 +108,6 @@ private String validateInput() throws IOException {
96108
r += "(!)BAM file does not exist: " + bamFile.getName() + "\n";
97109
return(r);
98110
}
99-
//check input extensions
100-
if(!"bam".equals(ExtensionFileFilter.getExtension(bamFile))){
101-
r += "(!)Is this a BAM file? Check extension: " + bamFile.getName() + "\n";
102-
}
103111
//check BAI exists
104112
File f = new File(bamFile+".bai");
105113
if(!f.exists() || f.isDirectory()){
@@ -117,13 +125,7 @@ private String validateInput() throws IOException {
117125
}else if(stdout){
118126
if(output!=null){ r += "(!)Cannot use -s flag with -o.\n"; }
119127
//check output filename is valid
120-
}else{
121-
//check ext
122-
try{
123-
if(!"bed".equals(ExtensionFileFilter.getExtensionIgnoreGZ(output))){
124-
r += "(!)Use BED extension for output filename. Try: " + ExtensionFileFilter.stripExtension(output) + ".bed\n";
125-
}
126-
} catch( NullPointerException e){ r += "(!)Output filename must have extension: use BED extension for output filename. Try: " + output + ".bed\n"; }
128+
} else {
127129
//check directory
128130
if(output.getParent()==null){
129131
// System.err.println("default to current directory");

src/main/java/scriptmanager/cli/BAM_Format_Converter/BAMtoGFFCLI.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@
1515
import scriptmanager.scripts.BAM_Format_Converter.BAMtoGFF;
1616

1717
/**
18-
BAM_Format_ConverterCLI/SEStatsCLI
19-
*/
18+
* Command line interface for
19+
* {@link scriptmanager.scripts.BAM_Format_Converter.BAMtoGFF}
20+
*
21+
* @author Olivia Lang
22+
*/
2023
@Command(name = "bam-to-gff", mixinStandardHelpOptions = true,
2124
description = ToolDescriptions.bam_to_gff_description,
2225
version = "ScriptManager "+ ToolDescriptions.VERSION,
2326
sortOptions = false,
2427
exitCodeOnInvalidInput = 1,
2528
exitCodeOnExecutionException = 1)
2629
public class BAMtoGFFCLI implements Callable<Integer> {
30+
31+
/**
32+
* Creates a new BAMtoGFFCLI object
33+
*/
34+
public BAMtoGFFCLI(){}
2735

2836
@Parameters( index = "0", description = "The BAM file from which we generate a new file.")
2937
private File bamFile;
@@ -61,6 +69,10 @@ static class ReadType {
6169
private int STRAND = -9999;
6270
private int PAIR;
6371

72+
/**
73+
* Runs when this subcommand is called, running script in respective script package with user defined arguments
74+
* @throws IOException Invalid file type
75+
*/
6476
@Override
6577
public Integer call() throws Exception {
6678
System.err.println( ">BAMtoGFFCLI.call()" );
@@ -96,10 +108,6 @@ private String validateInput() throws IOException {
96108
r += "(!)BAM file does not exist: " + bamFile.getName() + "\n";
97109
return(r);
98110
}
99-
//check input extensions
100-
if(!"bam".equals(ExtensionFileFilter.getExtension(bamFile))){
101-
r += "(!)Is this a BAM file? Check extension: " + bamFile.getName() + "\n";
102-
}
103111
//check BAI exists
104112
File f = new File(bamFile+".bai");
105113
if(!f.exists() || f.isDirectory()){
@@ -118,12 +126,6 @@ private String validateInput() throws IOException {
118126
if(output!=null){ r += "(!)Cannot use -s flag with -o.\n"; }
119127
//check output filename is valid
120128
}else{
121-
//check ext
122-
try{
123-
if(!"gff".equals(ExtensionFileFilter.getExtension(output))){
124-
r += "(!)Use GFF extension for output filename. Try: " + ExtensionFileFilter.stripExtension(output) + ".gff\n";
125-
}
126-
} catch( NullPointerException e){ r += "(!)Output filename must have extension: use GFF extension for output filename. Try: " + output + ".gff\n"; }
127129
//check directory
128130
if(output.getParent()==null){
129131
// System.err.println("default to current directory");

0 commit comments

Comments
 (0)