|
10 | 10 | import org.apache.logging.log4j.Logger; |
11 | 11 | import org.jetbrains.annotations.Nullable; |
12 | 12 | import org.json.JSONObject; |
| 13 | +import org.labkey.api.collections.CaseInsensitiveHashMap; |
13 | 14 | import org.labkey.api.pipeline.PipelineJobException; |
14 | 15 | import org.labkey.api.reader.Readers; |
15 | 16 | import org.labkey.api.sequenceanalysis.SequenceAnalysisService; |
@@ -170,7 +171,7 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno |
170 | 171 | throw new PipelineJobException("Unable to find pedigree file: " + pedFile.getPath()); |
171 | 172 | } |
172 | 173 |
|
173 | | - File kingFam = createFamFile(pedFile, new File(plinkOutBed.getParentFile(), "plink.fam"), kingArgs); |
| 174 | + File kingFam = createFamFile(pedFile, new File(plinkOutBed.getParentFile(), "plink.fam")); |
174 | 175 | kingArgs.add("--ped"); |
175 | 176 | kingArgs.add(kingFam.getPath()); |
176 | 177 |
|
@@ -213,11 +214,11 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno |
213 | 214 | return output; |
214 | 215 | } |
215 | 216 |
|
216 | | - private File createFamFile(File pedFile, File famFile, List<String> kingArgs) throws PipelineJobException |
| 217 | + private File createFamFile(File pedFile, File famFile) throws PipelineJobException |
217 | 218 | { |
218 | 219 | File newFamFile = new File(famFile.getParentFile(), "king.fam"); |
219 | 220 |
|
220 | | - Map<String, String> pedMap = new HashMap<>(); |
| 221 | + Map<String, String> pedMap = new CaseInsensitiveHashMap<>(); |
221 | 222 | try (BufferedReader reader = Readers.getReader(pedFile)) |
222 | 223 | { |
223 | 224 | String line; |
@@ -251,10 +252,13 @@ private File createFamFile(File pedFile, File famFile, List<String> kingArgs) th |
251 | 252 | String newRow = pedMap.get(tokens[1]); |
252 | 253 | if (newRow == null) |
253 | 254 | { |
254 | | - throw new PipelineJobException("Unable to find pedigree entry for: " + tokens[1]); |
| 255 | + getPipelineCtx().getLogger().warn("Unable to find pedigree entry for: " + tokens[1] + ", reusing original"); |
| 256 | + writer.println(line); |
| 257 | + } |
| 258 | + else |
| 259 | + { |
| 260 | + writer.println(newRow); |
255 | 261 | } |
256 | | - |
257 | | - writer.println(newRow); |
258 | 262 | } |
259 | 263 | } |
260 | 264 | catch (IOException e) |
|
0 commit comments