Skip to content

Commit

Permalink
Cuppa: updated version to use latest SV factory
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesshale committed Sep 11, 2024
1 parent e4c22c3 commit 33ee63e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public void extractSingleSample(boolean keepDataItems)
for(CategoryType categoryType : mConfig.Categories)
{
CategoryPrep categoryPrep = createCategoryPrep(categoryType);
SampleOneCategoryTask sampleTask = new SampleOneCategoryTask(0, mConfig, categoryPrep, null);
SamplePrepTask sampleTask = new SamplePrepTask(0, mConfig, categoryPrep, null);
sampleTask.run();
dataItems.addAll(sampleTask.mDataItems);
dataItems.addAll(sampleTask.dataItems());
}

if(keepDataItems)
Expand All @@ -116,11 +116,11 @@ public DataItemMatrix extractMultiSampleOneCategory(CategoryType categoryType)

ConcurrentHashMap<DataItem.Index, String[]> featureBySampleMatrix = new ConcurrentHashMap<>();

List<SampleOneCategoryTask> sampleTasks = new ArrayList<>();
List<SamplePrepTask> sampleTasks = new ArrayList<>();
for(int sampleIndex = 0; sampleIndex < mConfig.SampleIds.size(); ++sampleIndex)
{
CategoryPrep categoryPrep = createCategoryPrep(categoryType);
sampleTasks.add(new SampleOneCategoryTask(sampleIndex, mConfig, categoryPrep, featureBySampleMatrix));
sampleTasks.add(new SamplePrepTask(sampleIndex, mConfig, categoryPrep, featureBySampleMatrix));
}

List<Callable> callableTasks = sampleTasks.stream().collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@

import org.jetbrains.annotations.Nullable;

public class SampleOneCategoryTask implements Callable
public class SamplePrepTask implements Callable
{
public final PrepConfig mConfig;
public final int mSampleIndex;
public final String mSampleName;
private final PrepConfig mConfig;
private final int mSampleIndex;
private final String mSampleName;

@Nullable public CategoryPrep mCategoryPrep;
@Nullable private CategoryPrep mCategoryPrep;

@Nullable public List<DataItem> mDataItems;
@Nullable public ConcurrentHashMap<DataItem.Index, String[]> FeatureBySampleMatrix;
@Nullable private List<DataItem> mDataItems;
@Nullable private ConcurrentHashMap<DataItem.Index, String[]> FeatureBySampleMatrix;

public SampleOneCategoryTask(
public SamplePrepTask(
final int sampleIndex,
final PrepConfig prepConfig,
CategoryPrep categoryPrep,
@Nullable ConcurrentHashMap<DataItem.Index, String[]> featureBySampleMatrix)
final CategoryPrep categoryPrep,
@Nullable final ConcurrentHashMap<DataItem.Index,String[]> featureBySampleMatrix)
{
mConfig = prepConfig;
mCategoryPrep = categoryPrep;
Expand Down Expand Up @@ -63,15 +63,11 @@ public synchronized void addDataItemsToMatrix()
}
}

public void clearDataItems()
{
mDataItems = null;
}
public List<DataItem> dataItems() { return mDataItems; }

public void clearCategoryPrep()
{
mCategoryPrep = null;
}
public void clearDataItems() { mDataItems = null; }

public void clearCategoryPrep() { mCategoryPrep = null; }

public void run()
{
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<cobalt.version>2.0</cobalt.version>
<compar.version>1.3</compar.version>
<crest.version>1.0.0</crest.version>
<cuppa.version>2.2.1</cuppa.version>
<cuppa.version>2.3</cuppa.version>
<esvee.version>1.0</esvee.version>
<fastq-tools.version>1.0</fastq-tools.version>
<gene-utils.version>1.2</gene-utils.version>
Expand Down

0 comments on commit 33ee63e

Please sign in to comment.