X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFeaturesFile.java;fp=src%2Fjalview%2Fio%2FFeaturesFile.java;h=745bce3ad9bc0726a0b2688918ed3e7dc8dd9836;hb=3459a8a691cb22508d7067f240b7254e588e77d3;hp=71fc659c9d178d9a7ff2a4f215126535c79f6bb5;hpb=5b27f1062b2203c4c31702e205f4c78e1992063e;p=jalview.git diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index 71fc659..745bce3 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -110,12 +110,12 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI /** * Constructor which does not parse the file immediately * - * @param file File or String filename + * @param file + * File or String filename * @param paste * @throws IOException */ - public FeaturesFile(Object file, DataSourceType paste) - throws IOException + public FeaturesFile(Object file, DataSourceType paste) throws IOException { super(false, file, paste); } @@ -568,21 +568,19 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI } /** - * Returns contents of a Jalview format features file, for visible features, as - * filtered by type and group. Features with a null group are displayed if their - * feature type is visible. Non-positional features may optionally be included - * (with no check on type or group). + * Returns contents of a Jalview format features file, for visible features, + * as filtered by type and group. Features with a null group are displayed if + * their feature type is visible. Non-positional features may optionally be + * included (with no check on type or group). * * @param sequences * @param fr * @param includeNonPositional - * if true, include non-positional features - * (regardless of group or type) + * if true, include non-positional features (regardless of group or + * type) * @param includeComplement - * if true, include visible complementary - * (CDS/protein) positional features, with - * locations converted to local sequence - * coordinates + * if true, include visible complementary (CDS/protein) positional + * features, with locations converted to local sequence coordinates * @return */ public String printJalviewFormat(SequenceI[] sequences, @@ -604,8 +602,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI .entrySet()) { FeatureColourI colour = featureColour.getValue(); - out.append(colour.toJalviewFormat(featureColour.getKey())).append( - newline); + out.append(colour.toJalviewFormat(featureColour.getKey())) + .append(newline); } } @@ -634,8 +632,9 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI /** * Outputs any visible complementary (CDS/peptide) positional features as - * Jalview format, within feature group. The coordinates of the linked features - * are converted to the corresponding positions of the local sequences. + * Jalview format, within feature group. The coordinates of the linked + * features are converted to the corresponding positions of the local + * sequences. * * @param out * @param fr @@ -686,7 +685,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI /* * output features by group */ - for (Entry>> groupFeatures : map.entrySet()) + for (Entry>> groupFeatures : map + .entrySet()) { out.append(newline); String group = groupFeatures.getKey(); @@ -766,8 +766,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI } /** - * Outputs any feature filters defined for visible feature types, sandwiched by - * STARTFILTERS and ENDFILTERS lines + * Outputs any feature filters defined for visible feature types, sandwiched + * by STARTFILTERS and ENDFILTERS lines * * @param out * @param visible @@ -817,9 +817,9 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @param includeNonPositional * @return */ - private int outputFeaturesByGroup(StringBuilder out, - FeatureRenderer fr, String[] featureTypes, - SequenceI[] sequences, boolean includeNonPositional) + private int outputFeaturesByGroup(StringBuilder out, FeatureRenderer fr, + String[] featureTypes, SequenceI[] sequences, + boolean includeNonPositional) { List featureGroups = fr.getFeatureGroups(); @@ -868,8 +868,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI if (featureTypes.length > 0 && (isNullGroup || visibleGroups.contains(group))) { - features.addAll(sequences[i].getFeatures().getFeaturesForGroup( - true, group, featureTypes)); + features.addAll(sequences[i].getFeatures() + .getFeaturesForGroup(true, group, featureTypes)); } for (SequenceFeature sf : features) @@ -907,9 +907,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @param sequenceName * @param sequenceFeature */ - protected void formatJalviewFeature( - StringBuilder out, String sequenceName, - SequenceFeature sequenceFeature) + protected void formatJalviewFeature(StringBuilder out, + String sequenceName, SequenceFeature sequenceFeature) { if (sequenceFeature.description == null || sequenceFeature.description.equals("")) @@ -1019,19 +1018,16 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * Returns features output in GFF2 format * * @param sequences - * the sequences whose features are to be - * output + * the sequences whose features are to be output * @param visible - * a map whose keys are the type names of - * visible features + * a map whose keys are the type names of visible features * @param visibleFeatureGroups * @param includeNonPositionalFeatures * @param includeComplement * @return */ - public String printGffFormat(SequenceI[] sequences, - FeatureRenderer fr, boolean includeNonPositionalFeatures, - boolean includeComplement) + public String printGffFormat(SequenceI[] sequences, FeatureRenderer fr, + boolean includeNonPositionalFeatures, boolean includeComplement) { FeatureRenderer fr2 = null; if (includeComplement) @@ -1040,11 +1036,13 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI fr2 = Desktop.getAlignFrameFor(comp).getFeatureRenderer(); } - Map visibleColours = fr.getDisplayedFeatureCols(); + Map visibleColours = fr + .getDisplayedFeatureCols(); StringBuilder out = new StringBuilder(256); - out.append(String.format("%s %d\n", GFF_VERSION, gffVersion == 0 ? 2 : gffVersion)); + out.append(String.format("%s %d\n", GFF_VERSION, + gffVersion == 0 ? 2 : gffVersion)); String[] types = visibleColours == null ? new String[0] : visibleColours.keySet() @@ -1139,17 +1137,17 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * AC_Male=0;AF_NFE=0.00000e 00;Hom_FIN=0;GQ_MEDIAN=9 * * - * A map-valued attribute is formatted as a comma-delimited list within braces, - * for example + * A map-valued attribute is formatted as a comma-delimited list within + * braces, for example * *
    * jvmap_CSQ={ALLELE_NUM=1,UNIPARC=UPI0002841053,Feature=ENST00000585561}
    * 
* - * The {@code jvmap_} prefix designates a values map and is removed if the value - * is parsed when read in. (The GFF3 specification allows 'semi-structured data' - * to be represented provided the attribute name begins with a lower case - * letter.) + * The {@code jvmap_} prefix designates a values map and is removed if the + * value is parsed when read in. (The GFF3 specification allows + * 'semi-structured data' to be represented provided the attribute name begins + * with a lower case letter.) * * @param sb * @param map @@ -1236,11 +1234,11 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * format) * * @param alignedRegions - * a list of "Align fromStart toStart fromCount" + * a list of "Align fromStart toStart fromCount" * @param mapIsFromCdna - * if true, 'from' is dna, else 'from' is protein + * if true, 'from' is dna, else 'from' is protein * @param strand - * either 1 (forward) or -1 (reverse) + * either 1 (forward) or -1 (reverse) * @return * @throws IOException */ @@ -1458,8 +1456,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI List sfs = seq.getFeatures().getPositionalFeatures(); if (!sfs.isEmpty()) { - String newName = (String) sfs.get(0).getValue( - GffHelperI.RENAME_TOKEN); + String newName = (String) sfs.get(0) + .getValue(GffHelperI.RENAME_TOKEN); if (newName != null) { seq.setName(newName);