Skip to content

Commit 786a87c

Browse files
author
eoberortner
committed
resolved conflicts
2 parents b1d1e48 + 661af53 commit 786a87c

5 files changed

Lines changed: 156 additions & 1 deletion

File tree

src/main/java/gov/doe/jgi/boost/client/BOOSTClient.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,37 @@ public String dnaVarification(
238238
filenameSequences, vendor, sequencePatternsFilename));
239239
}
240240

241+
/**
242+
* The partition() method Partitioning of large DNA sequences into synthesizable
243+
* building blocks with partial overlaps for an efficient assembly.
244+
*
245+
* @throws BOOSTClientException
246+
* @throws BOOSTBackEndException
247+
*/
248+
249+
public String partition(
250+
String sequenceFileName,
251+
String fivePrimeVectorOverlap,
252+
String threePrimeVectorOverlap,
253+
String minLengthBB,
254+
String maxLengthBB,
255+
String minOverlapGC,
256+
String optOverlapGC,
257+
String maxOverlapGC,
258+
String minOverlapLength,
259+
String optOverlapLength,
260+
String maxOverlapLength)
261+
throws BOOSTClientException, BOOSTBackEndException {
262+
263+
// construct the request's JSON object
264+
JSONObject requestData = RequestBuilder.buildPartation(sequenceFileName, fivePrimeVectorOverlap,
265+
threePrimeVectorOverlap, minLengthBB, maxLengthBB, minOverlapGC, optOverlapGC, maxOverlapGC,
266+
minOverlapLength, optOverlapLength, maxOverlapLength);
267+
268+
return submitJob(requestData);
269+
}
270+
271+
241272
/**
242273
* The submitJob method submits a job to the BOOST back-end and returns
243274
* the UUID (as String) of the submitted job.

src/main/java/gov/doe/jgi/boost/client/RequestBuilder.java

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,97 @@ public static JSONObject buildPolish(
277277
return modifiedData;
278278
}
279279

280+
/**
281+
* The buildPartation wraps all required information for
282+
* BOOST's dna partition functionality into a JSON representation
283+
*
284+
* @return a JSONObject that represents the input values
285+
*
286+
* @throws BOOSTClientException ... if any given value is NULL or any given String value is empty
287+
* */
288+
289+
public static JSONObject buildPartation(
290+
final String sequenceFileName,
291+
final String fivePrimeVectorOverlap,
292+
final String threePrimeVectorOverlap,
293+
String minLengthBB,
294+
String maxLengthBB,
295+
String minOverlapGC,
296+
String optOverlapGC,
297+
String maxOverlapGC,
298+
String minOverlapLength,
299+
String optOverlapLength,
300+
String maxOverlapLength)
301+
throws BOOSTClientException{
302+
303+
//verify the values
304+
ParameterValueVerifier.verifyFilename(BOOSTConstants.INPUT_FILENAME, sequenceFileName);
305+
ParameterValueVerifier.verifyValue(BOOSTConstants.FIVE_PRIME_VECTOR_OVERLAP, fivePrimeVectorOverlap);
306+
ParameterValueVerifier.verifyValue(BOOSTConstants.THREE_PRIME_VECTOR_OVERLAP, threePrimeVectorOverlap);
307+
ParameterValueVerifier.verifyValue(BOOSTConstants.MIN_BB_LENGTH, minLengthBB);
308+
ParameterValueVerifier.verifyValue(BOOSTConstants.MAX_BB_LENGTH, maxLengthBB);
309+
ParameterValueVerifier.verifyValue(BOOSTConstants.MIN_OVERLAP_GC, minOverlapGC);
310+
ParameterValueVerifier.verifyValue(BOOSTConstants.OPT_OVERLAP_GC, optOverlapGC);
311+
ParameterValueVerifier.verifyValue(BOOSTConstants.MAX_OVERLAP_GC, maxOverlapGC);
312+
ParameterValueVerifier.verifyValue(BOOSTConstants.MIN_OVERLAP_LENGTH, minOverlapGC);
313+
ParameterValueVerifier.verifyValue(BOOSTConstants.OPT_OVERLAP_LENGTH, optOverlapGC);
314+
ParameterValueVerifier.verifyValue(BOOSTConstants.MAX_OVERLAP_LENGTH, maxOverlapLength);
315+
316+
//----------------------------------------------
317+
318+
// build the JSON representation of the input values
319+
JSONObject partationData = new JSONObject();
320+
321+
//----------------------------------------------
322+
323+
324+
// JOB INFORMATION
325+
partationData.put(JSONKeys.JOB_INFORMATION,
326+
RequestBuilder.buildJobInformation(BOOSTFunctions.PARTITION));
327+
//----------------------------------------------
328+
329+
330+
// sequence information
331+
partationData.put(JSONKeys.SEQUENCE_INFORMATION,
332+
RequestBuilder.buildSequenceData(sequenceFileName, SequenceType.DNA, false));
333+
334+
// partition information
335+
partationData.put(JSONKeys.PARTITIONING_INFORMATION,
336+
RequestBuilder.buildPartitionData(sequenceFileName, fivePrimeVectorOverlap,
337+
threePrimeVectorOverlap, minLengthBB, maxLengthBB, minOverlapGC, optOverlapGC,
338+
maxOverlapGC, minOverlapLength, optOverlapLength, maxOverlapLength));
339+
340+
341+
return partationData;
342+
343+
}
344+
345+
private static JSONObject buildPartitionData(final String sequenceFileName,
346+
final String fivePrimeVectorOverlap, final String threePrimeVectorOverlap,
347+
String minLengthBB, String maxLengthBB, String minOverlapGC, String optOverlapGC,
348+
String maxOverlapGC, String minOverlapLength, String optOverlapLength, String maxOverlapLength){
349+
350+
JSONObject partationData = new JSONObject();
351+
//JSONObject subPartationData = new JSONObject();
352+
partationData.put(JSONKeys.FIVE_PRIME_VECTOR_OVERLAP, fivePrimeVectorOverlap);
353+
partationData.put(JSONKeys.THREE_PRIME_VECTOR_OVERLAP, threePrimeVectorOverlap);
354+
partationData.put(JSONKeys.MAX_BB_LENGTH, maxLengthBB);
355+
partationData.put(JSONKeys.MIN_BB_LENGTH, minLengthBB);
356+
partationData.put(JSONKeys.MAX_OVERLAP_GC, maxOverlapGC);
357+
partationData.put(JSONKeys.BATCH, "");
358+
partationData.put(JSONKeys.MIN_OVERLAP_GC, minOverlapGC);
359+
partationData.put(JSONKeys.MAX_OVERLAP_LENGTH, maxOverlapLength);
360+
partationData.put(JSONKeys.OPT_OVERLAP_GC, optOverlapGC);
361+
partationData.put(JSONKeys.OPT_OVERLAP_LENGTH, optOverlapLength);
362+
partationData.put(JSONKeys.MIN_OVERLAP_LENGTH, minOverlapLength);
363+
364+
JSONObject partationParameters = new JSONObject();
365+
partationParameters.put(JSONKeys.PARTITIONING_INFORMATION, partationData);
366+
367+
return partationData;
368+
}
369+
370+
280371
/**
281372
*
282373
* @param function

src/main/java/gov/doe/jgi/boost/client/constants/BOOSTConstants.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,19 @@ public class BOOSTConstants {
1515

1616
// uri for signup
1717
public static final String SIGNUP_URI = "https://contacts.jgi.doe.gov/registration/new";
18-
18+
19+
// partitioning-related keys
20+
public static final String PARTITIONING_INFORMATION = "partitioning-parameters";
21+
public static final String MIN_BB_LENGTH = "min-BB-length";
22+
public static final String MAX_BB_LENGTH = "max-BB-length";
23+
public static final String MIN_OVERLAP_GC = "min-overlap-GC";
24+
public static final String OPT_OVERLAP_GC = "opt-overlap-GC";
25+
public static final String MAX_OVERLAP_GC = "max-overlap-GC";
26+
public static final String MIN_OVERLAP_LENGTH = "min-overlap-length";
27+
public static final String OPT_OVERLAP_LENGTH = "opt-overlap-length";
28+
public static final String MAX_OVERLAP_LENGTH = "max-overlap-length";
29+
public static final String FIVE_PRIME_VECTOR_OVERLAP = "5-prime-vector-overlap";
30+
public static final String THREE_PRIME_VECTOR_OVERLAP = "3-prime-vector-overlap";
31+
public static final String BATCH = "batch";
32+
1933
}

src/main/java/gov/doe/jgi/boost/client/constants/JSONKeys.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class JSONKeys {
4949
public static final String MAX_OVERLAP_LENGTH = "max-overlap-length";
5050
public static final String FIVE_PRIME_VECTOR_OVERLAP = "5-prime-vector-overlap";
5151
public static final String THREE_PRIME_VECTOR_OVERLAP = "3-prime-vector-overlap";
52+
public static final String BATCH = "batch";
5253

5354
// output-related keys
5455
public static final String OUTPUT_INFORMATION = "output";

src/test/java/gov/doe/jgi/boost/client/DemoClient.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,24 @@ public static void main(String[] args)
8787
jobUUIDs.add(polishDNAJobUUID);
8888
}
8989

90+
// partitioning of DNA
91+
String partitiongDNAJobUUID = client.partition(
92+
"./data/dna.fasta", // input sequence
93+
"aaacccgggttt", // 5-prime-vector-overlap
94+
"tttgggcccaaa", // 3-prime-vector-overlap
95+
Integer.toString(15), // min-BB-length
96+
Integer.toString(3000), // max-BB-length
97+
Double.toString(4.0), // minimum overlap GC
98+
Double.toString(40.0), // optimum overlap GC
99+
Double.toString(62.0), // maximum overlap GC
100+
Integer.toString(5), // minimum overlap length
101+
Integer.toString(25), // optimum overlap length
102+
Integer.toString(30) // maximum overlap length
103+
);
104+
if (null != partitiongDNAJobUUID) {
105+
jobUUIDs.add(polishDNAJobUUID);
106+
}
107+
90108

91109
// for all jobs, we check their status
92110
for(String jobUUID : jobUUIDs) {

0 commit comments

Comments
 (0)