Skip to content

Commit ea52520

Browse files
committed
Dont throw when non-existent field specified for JBrowse indexing
1 parent 8ce04df commit ea52520

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

jbrowse/src/org/labkey/jbrowse/JBrowseFieldUtils.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
import htsjdk.variant.vcf.VCFHeader;
55
import htsjdk.variant.vcf.VCFHeaderLineType;
66
import htsjdk.variant.vcf.VCFInfoHeaderLine;
7+
import org.apache.logging.log4j.LogManager;
8+
import org.apache.logging.log4j.Logger;
79
import org.labkey.api.data.Container;
810
import org.labkey.api.jbrowse.JBrowseFieldDescriptor;
911
import org.labkey.api.security.User;
12+
import org.labkey.api.util.logging.LogHelper;
1013
import org.labkey.jbrowse.model.JBrowseSession;
1114
import org.labkey.jbrowse.model.JsonFile;
1215

@@ -16,6 +19,8 @@
1619

1720
public class JBrowseFieldUtils
1821
{
22+
private static final Logger _log = LogHelper.getLogger(JBrowseFieldUtils.class, "Logger for JBrowseFieldUtils");
23+
1924
public static final String VARIABLE_SAMPLES = "variableSamples";
2025

2126
// These fields are always indexed in DISCVRSeq, and present in all VCFs (or created client-side in ExtendedVariantAdapter
@@ -46,7 +51,8 @@ public static Map<String, JBrowseFieldDescriptor> getIndexedFields(JsonFile json
4651
{
4752
if (!header.hasInfoLine(fn))
4853
{
49-
throw new IllegalArgumentException("Field not present: " + fn);
54+
_log.error("Field requested for JBrowse indexing, but was not present: " + fn + ", for JsonFile: " + jsonFile.getObjectId());
55+
continue;
5056
}
5157

5258
VCFInfoHeaderLine info = header.getInfoHeaderLine(fn);

0 commit comments

Comments
 (0)