Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions genotyping/src/org/labkey/genotyping/HaplotypeProtocolBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,7 @@
* Date: 12/14/12
*/

public class HaplotypeProtocolBean
public record HaplotypeProtocolBean(HaplotypeDataCollector<?> dataCollector, ExpProtocol protocol)
{
private final HaplotypeDataCollector dataCollector;
private final ExpProtocol protocol;

public HaplotypeProtocolBean(HaplotypeDataCollector dataCollector, ExpProtocol protocol){
this.dataCollector = dataCollector;
this.protocol = protocol;
}

public HaplotypeDataCollector getDataCollector(){
return dataCollector;
}

public ExpProtocol getProtocol(){
return protocol;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public TableInfo getTable(String name, @Nullable ContainerFilter cf, boolean inc
@Override
public @Nullable TableInfo createDataTable(ContainerFilter cf, boolean includeCopiedToStudyColumns)
{
FilteredTable<?> table = (FilteredTable)new GenotypingQuerySchema(getUser(), getContainer()).getTable(GenotypingQuerySchema.TableType.AnimalAnalysis.name(), cf,true, true);
FilteredTable<?> table = (FilteredTable<?>)new GenotypingQuerySchema(getUser(), getContainer()).getTable(GenotypingQuerySchema.TableType.AnimalAnalysis.name(), cf,true, true);
List<FieldKey> keys = new ArrayList<>(table.getDefaultVisibleColumns());
HashSet<String> defaults = HaplotypeAssayProvider.getDefaultColumns();
List<? extends DomainProperty> props = HaplotypeAssayProvider.getDomainProps(getProtocol());
Expand Down Expand Up @@ -147,14 +147,15 @@ private ExprColumn makeColumnFromRunField(DomainProperty prop, boolean max, SQLF

String field = prop.getName();
String label = prop.getLabel() != null ? prop.getLabel() : ColumnInfo.labelFromName(prop.getName());
String type = field.substring(0, prop.getName().length()-1).replaceAll("Haplotype", ""); //ColumnInfo.labelFromName(prop.getName()).split(" ")[0];
String type = field.substring(0, prop.getName().length()-1).replace("Haplotype", ""); //ColumnInfo.labelFromName(prop.getName()).split(" ")[0];

SQLFragment sql = new SQLFragment("(SELECT ");
sql.append("min");
sql.append("(x.Haplotype) FROM (");
sql.append(selectStatement);
sql.append(") AS x WHERE x.DiploidNumber = ? AND x.Type = '" + type + "' AND x.AnimalAnalysisId = " + ExprColumn.STR_TABLE_ALIAS + ".RowID)");
sql.append(") AS x WHERE x.DiploidNumber = ? AND x.Type = ? AND x.AnimalAnalysisId = " + ExprColumn.STR_TABLE_ALIAS + ".RowID)");
sql.add(max ? 2 : 1);
sql.add(type);
ExprColumn column = new ExprColumn(table, field, sql, JdbcType.VARCHAR);
TableInfo haplotypeDetailsTableInfo = getHaplotypeDetailsTableInfo();
if (haplotypeDetailsTableInfo != null && haplotypeDetailsTableInfo.getGridURL(getContainer()) != null)
Expand All @@ -180,8 +181,7 @@ public DataView createDataView()
{
DataView result = super.createDataView();
DataRegion rgn = result.getDataRegion();

ButtonBar bar = result.getDataRegion().getButtonBar(DataRegion.MODE_GRID);
ButtonBar bar = rgn.getButtonBar(DataRegion.MODE_GRID);
if (!bar.isLocked())
{
ActionButton reportButton = new ActionButton(GenotypingController.HaplotypeAssignmentReportAction.class, "Produce Report");
Expand Down
8 changes: 2 additions & 6 deletions genotyping/src/org/labkey/genotyping/IlluminaFastqParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.apache.commons.collections4.ListValuedMap;
import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
import org.junit.Assert;
import org.junit.Before;
Expand Down Expand Up @@ -58,10 +58,6 @@
* This is designed to parse the FASTQ files produced by a single run on an Illumina instrument and produce one gzipped FASTQ
* for each sample in that run. Parsing that CSV file to obtain the sample list is upstream of this class.
* It is designed to be called from a pipeline job, although it should not need to be.
*
* User: bbimber
* Date: 4/18/12
* Time: 11:35 AM
*/
public class IlluminaFastqParser
{
Expand Down Expand Up @@ -351,7 +347,7 @@ else if(rc == 0 && readCount != 0)
return fileName + " has " + readCount + " reads, while its pair file is empty and has 0 reads.";
}
else
m.put(fileNameWithoutPairingInfo, Integer.valueOf(readCount));
m.put(fileNameWithoutPairingInfo, readCount);

return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<%
JspView<HaplotypeProtocolBean> me = HttpView.currentView();
HaplotypeProtocolBean bean = me.getModelBean();
HaplotypeDataCollector dataCollector = bean.getDataCollector();
HaplotypeDataCollector dataCollector = bean.dataCollector();
String[] reshowData = {};
if (dataCollector.getReshowValue("data") != null && !dataCollector.getReshowValue("data").isEmpty())
{
Expand All @@ -42,7 +42,7 @@
<script type="text/javascript" nonce="<%=getScriptNonce()%>">
var expectedHeaders = [];
<%
for (Map.Entry<String, HaplotypeColumnMappingProperty> property : HaplotypeAssayProvider.getColumnMappingProperties(bean.getProtocol()).entrySet())
for (Map.Entry<String, HaplotypeColumnMappingProperty> property : HaplotypeAssayProvider.getColumnMappingProperties(bean.protocol()).entrySet())
{
%>expectedHeaders.push({name: '<%=h(property.getKey())%>', label: '<%=h(property.getValue().getLabel())%>', reshowValue: '<%=h(dataCollector.getReshowValue(property.getKey()))%>', required: <%=property.getValue().isRequired()%>});<%
}
Expand Down
Loading