plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/Illumina.java

Code
Comments
Other
Rev Date Author Line
556 28 Jan 08 nicklas 1 /**
566 01 Feb 08 nicklas 2   $Id$
556 28 Jan 08 nicklas 3
646 10 Apr 08 jari 4   Copyright (C) 2008 Nicklas Nordborg
556 28 Jan 08 nicklas 5
556 28 Jan 08 nicklas 6   This file is part of Illumina plug-in package for BASE.
556 28 Jan 08 nicklas 7   Available at http://baseplugins.thep.lu.se/
556 28 Jan 08 nicklas 8   BASE main site: http://base.thep.lu.se/
556 28 Jan 08 nicklas 9
941 27 Jan 09 martin 10   This is a free software; you can redistribute it and/or modify it
940 27 Jan 09 martin 11   under the terms of the GNU General Public License as published by
940 27 Jan 09 martin 12   the Free Software Foundation; either version 3 of the License, or
940 27 Jan 09 martin 13   (at your option) any later version.
940 27 Jan 09 martin 14    
941 27 Jan 09 martin 15   This software is distributed in the hope that it will be useful, but
940 27 Jan 09 martin 16   WITHOUT ANY WARRANTY; without even the implied warranty of
940 27 Jan 09 martin 17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
940 27 Jan 09 martin 18   General Public License for more details.
940 27 Jan 09 martin 19   
556 28 Jan 08 nicklas 20   You should have received a copy of the GNU General Public License
940 27 Jan 09 martin 21   along with BASE. If not, see <http://www.gnu.org/licenses/>.
556 28 Jan 08 nicklas 22 */
556 28 Jan 08 nicklas 23 package net.sf.basedb.illumina;
556 28 Jan 08 nicklas 24
1385 02 Sep 11 martin 25 import net.sf.basedb.core.FileStoreEnabled;
1385 02 Sep 11 martin 26 import net.sf.basedb.core.InvalidUseOfNullException;
1385 02 Sep 11 martin 27 import net.sf.basedb.core.Platform;
560 29 Jan 08 nicklas 28 import net.sf.basedb.core.RawDataType;
560 29 Jan 08 nicklas 29 import net.sf.basedb.core.RawDataTypes;
686 30 Apr 08 jari 30 import net.sf.basedb.core.Type;
556 28 Jan 08 nicklas 31
560 29 Jan 08 nicklas 32
556 28 Jan 08 nicklas 33 public class Illumina 
556 28 Jan 08 nicklas 34 {
1386 06 Sep 11 nicklas 35   /**
1386 06 Sep 11 nicklas 36     The current version of this package.
1386 06 Sep 11 nicklas 37   */
1448 02 Nov 11 nicklas 38   public static final String VERSION = "1.8-dev";
1386 06 Sep 11 nicklas 39   
556 28 Jan 08 nicklas 40
556 28 Jan 08 nicklas 41   /**
556 28 Jan 08 nicklas 42     The URL where more information about this plug-in package can
556 28 Jan 08 nicklas 43     be found.
556 28 Jan 08 nicklas 44   */
556 28 Jan 08 nicklas 45   public static final String URL = "http://baseplugins.thep.lu.se/wiki/net.sf.basedb.illumina";
1385 02 Sep 11 martin 46
556 28 Jan 08 nicklas 47   /**
556 28 Jan 08 nicklas 48     The ID for the main Illumina platform item. Use
560 29 Jan 08 nicklas 49     <code>Platform.getByExternalId(dc, Illumina.PLATFORM_ID)<code>
556 28 Jan 08 nicklas 50     to load this item.
556 28 Jan 08 nicklas 51   */
560 29 Jan 08 nicklas 52   public static final String PLATFORM_ID = "illumina";
556 28 Jan 08 nicklas 53   
566 01 Feb 08 nicklas 54   
560 29 Jan 08 nicklas 55   /**
566 01 Feb 08 nicklas 56     The ID for the Illumina SNP platform variant. Use
566 01 Feb 08 nicklas 57     <code>PlatformVariant.getByExternalId(dc, Illumina.SNP_VARIANT_ID)<code>
566 01 Feb 08 nicklas 58     to load this item.
589 20 Feb 08 martin 59   */
572 06 Feb 08 martin 60   public static final String SNP_VARIANT_ID = "illumina.snp";
566 01 Feb 08 nicklas 61   
566 01 Feb 08 nicklas 62   /**
589 20 Feb 08 martin 63      The ID for Illumina SNP manifest file types. Use
589 20 Feb 08 martin 64      <code>DataFileType.getByExternalId(dc, Illumina.SNP_MANIFEST_FILE_ID)</code>
589 20 Feb 08 martin 65      to load this item.
589 20 Feb 08 martin 66    */
589 20 Feb 08 martin 67   public static final String SNP_MANIFEST_FILE_ID = "illumina.snp.manifest";
589 20 Feb 08 martin 68   
589 20 Feb 08 martin 69   /**
589 20 Feb 08 martin 70      The ID for Illumina SNP split data file type. Use
589 20 Feb 08 martin 71      <code>DataFileType.getByExternalId(dc, Illumina.SNP_SPLITDATA_FILE_ID)</code>
589 20 Feb 08 martin 72      to load this item.
589 20 Feb 08 martin 73    */
589 20 Feb 08 martin 74   public static final String SNP_SPLITDATA_FILE_ID = "illumina.snp.splitdata";
589 20 Feb 08 martin 75   
589 20 Feb 08 martin 76   /**
589 20 Feb 08 martin 77      The ID for Illumina SNP orginal data file type. Use
589 20 Feb 08 martin 78      <code>DataFileType.getByExternalId(dc, Illumina.SNP_DATA_FILE_ID)</code>
589 20 Feb 08 martin 79      to load this item.
589 20 Feb 08 martin 80    */
589 20 Feb 08 martin 81   public static final String SNP_DATA_FILE_ID = "illumina.snp.data";
589 20 Feb 08 martin 82   
589 20 Feb 08 martin 83   /**
572 06 Feb 08 martin 84     The ID of the raw data type used to hold Illumina Bead Summary raw data.
572 06 Feb 08 martin 85     Use {@link #getBeadSummaryType()} to get the raw data type object.
560 29 Jan 08 nicklas 86   */
572 06 Feb 08 martin 87   public static final String BEAD_SUMMARY_ID = "illumina_bead_summary";
556 28 Jan 08 nicklas 88   
556 28 Jan 08 nicklas 89   /**
556 28 Jan 08 nicklas 90     The ID for the BGX {@link DataFileType}. Use
560 29 Jan 08 nicklas 91     <code>DataFileType.getByExternalId(dc, Illumina.BGX_FILE_ID)</code>
556 28 Jan 08 nicklas 92     to load this item.
556 28 Jan 08 nicklas 93   */
560 29 Jan 08 nicklas 94   public static final String BGX_FILE_ID = "illumina.bgx";
569 05 Feb 08 martin 95
569 05 Feb 08 martin 96   /**
686 30 Apr 08 jari 97      The ID for {@link ExtraValueType} required for Illumina detection
686 30 Apr 08 jari 98      P-value calculations using the DetectionPValue plug-in provided
686 30 Apr 08 jari 99      with this package.
686 30 Apr 08 jari 100    */
686 30 Apr 08 jari 101   public static final String DETECTION_PVALUE_ID = "IlluminaDetectionPValue";
686 30 Apr 08 jari 102
686 30 Apr 08 jari 103   /**
686 30 Apr 08 jari 104      The {@link ExtraValueType} {@link Type} required for Illumina
686 30 Apr 08 jari 105      detection P-value calculations using the DetectionPValue plug-in
686 30 Apr 08 jari 106      provided with this package.
686 30 Apr 08 jari 107    */
686 30 Apr 08 jari 108   public static final Type DETECTION_PVALUE_TYPE = Type.FLOAT;
686 30 Apr 08 jari 109
686 30 Apr 08 jari 110   /**
572 06 Feb 08 martin 111     Get the {@link RawDataType} representing the Illumina Bead Summary
560 29 Jan 08 nicklas 112     raw data type.
560 29 Jan 08 nicklas 113     @return A raw data type (null if this type is not present)
560 29 Jan 08 nicklas 114   */
572 06 Feb 08 martin 115   public static final RawDataType getBeadSummaryType()
560 29 Jan 08 nicklas 116   {
572 06 Feb 08 martin 117     return RawDataTypes.getRawDataType(BEAD_SUMMARY_ID);
560 29 Jan 08 nicklas 118   }
556 28 Jan 08 nicklas 119   
624 10 Mar 08 nicklas 120   /**
624 10 Mar 08 nicklas 121     Get the {@link RawDataType} representing the Illumina SNP 
624 10 Mar 08 nicklas 122     raw data type.
624 10 Mar 08 nicklas 123     @return A raw data type (null if this type is not present)
624 10 Mar 08 nicklas 124   */
624 10 Mar 08 nicklas 125   public static final RawDataType getSnpType()
624 10 Mar 08 nicklas 126   {
624 10 Mar 08 nicklas 127     return RawDataTypes.getRawDataType("variant." + SNP_VARIANT_ID);
624 10 Mar 08 nicklas 128   }
556 28 Jan 08 nicklas 129   
1385 02 Sep 11 martin 130   /**
1385 02 Sep 11 martin 131      Check if the item is using the Illumina-platform.   
1385 02 Sep 11 martin 132      @param item Item to check. Null is not allowed.
1385 02 Sep 11 martin 133      @return TRUE if platform is used, FALSE otherwise
1385 02 Sep 11 martin 134   */
1385 02 Sep 11 martin 135   public static boolean isIllumina(FileStoreEnabled item)
1385 02 Sep 11 martin 136   {
1385 02 Sep 11 martin 137     if (item == null) throw new InvalidUseOfNullException("item");
1385 02 Sep 11 martin 138     Platform platform = item.getPlatform();
1385 02 Sep 11 martin 139     if(platform == null || !Illumina.PLATFORM_ID.equals(platform.getExternalId()))
1385 02 Sep 11 martin 140     {
1385 02 Sep 11 martin 141       return false;      
1385 02 Sep 11 martin 142     }
1385 02 Sep 11 martin 143     return true;
1385 02 Sep 11 martin 144   }
556 28 Jan 08 nicklas 145 }