Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim very long peptide group names during import #923

Merged
Merged
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
11 changes: 7 additions & 4 deletions src/org/labkey/targetedms/parser/PeptideGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

package org.labkey.targetedms.parser;

import org.apache.commons.lang3.StringUtils;
import org.labkey.api.targetedms.RepresentativeDataState;
import org.labkey.targetedms.query.PeptideGroupManager;

Expand All @@ -30,6 +31,8 @@
*/
public class PeptideGroup extends AnnotatedEntity<PeptideGroupAnnotation>
{
private static final int MAX_LENGTH = 1050;

private long _runId;

private String _label;
Expand Down Expand Up @@ -64,7 +67,7 @@ public String getLabel()

public void setLabel(String label)
{
_label = label;
_label = StringUtils.truncate(label, MAX_LENGTH);
}

public String getName()
Expand All @@ -74,7 +77,7 @@ public String getName()

public void setName(String name)
{
_name = name;
_name = StringUtils.truncate(name, MAX_LENGTH);
}

public String getDescription()
Expand All @@ -84,7 +87,7 @@ public String getDescription()

public void setDescription(String description)
{
_description = description;
_description = StringUtils.truncate(description, MAX_LENGTH);
}

public boolean isDecoy()
Expand Down Expand Up @@ -153,7 +156,7 @@ public String getAltDescription()

public void setAltDescription(String altDescription)
{
_altDescription = altDescription;
_altDescription = StringUtils.truncate(altDescription, MAX_LENGTH);
}

public Protein addSingleProtein()
Expand Down