-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathResaving.java
More file actions
62 lines (49 loc) · 2.4 KB
/
Resaving.java
File metadata and controls
62 lines (49 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package examples;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import gui.STDataAssembly;
import io.SpatialDataContainer;
import io.SpatialDataIO;
import data.NormalizingSTData;
import data.STData;
import io.Path;
import io.TextFileIO;
public class Resaving
{
protected static void resaveNormalizedSlideSeq() throws IOException {
final String path = Path.getPath();
final String[] pucks = new String[] { "Puck_180602_20", "Puck_180602_18", "Puck_180602_17", "Puck_180602_16", "Puck_180602_15", "Puck_180531_23", "Puck_180531_22", "Puck_180531_19", "Puck_180531_18", "Puck_180531_17", "Puck_180531_13", "Puck_180528_22", "Puck_180528_20" };
final ExecutorService service = Executors.newFixedThreadPool(8);
final SpatialDataContainer container = SpatialDataContainer.openExisting(path + "slide-seq.n5", service);
for ( final String puck : pucks ) {
final STData stData = container.openDataset(puck + ".n5").readData().data();
final STData normalizedData = new NormalizingSTData( stData );
final SpatialDataIO sdout = SpatialDataIO.open(puck + "-normalized.n5", service);
sdout.writeData(new STDataAssembly(normalizedData));
}
service.shutdown();
}
protected static void resaveSlideSeq() throws IOException {
final String path = Path.getPath();
final String[] pucks = new String[] { "Puck_180602_20", "Puck_180602_18", "Puck_180602_17", "Puck_180602_16", "Puck_180602_15", "Puck_180531_23", "Puck_180531_22", "Puck_180531_19", "Puck_180531_18", "Puck_180531_17", "Puck_180531_13", "Puck_180528_22", "Puck_180528_20" };
final ExecutorService service = Executors.newFixedThreadPool(8);
final SpatialDataContainer container = SpatialDataContainer.createNew(path + "slide-seq.n5", service);
for ( final String puck : pucks ) {
final STData slideSeqOriginal = TextFileIO.readSlideSeq(
new File( path + "/slide-seq/" + puck + "/BeadLocationsForR.csv" ),
new File( path + "/slide-seq/" + puck + "/MappedDGEForR.csv" ) );
SpatialDataIO sdout = SpatialDataIO.open(puck + ".n5", service);
sdout.writeData(new STDataAssembly(slideSeqOriginal));
}
System.out.println( "done" );
service.shutdown();
}
public static void main( String[] args ) throws IOException, InterruptedException, ExecutionException
{
resaveSlideSeq();
resaveNormalizedSlideSeq();
}
}