Exemplo n.º 1
0
        protected double getPrecursorIsolationWindowParams(Spectrum spectrum, CVID cvid)
        {
            double result     = -1;
            var    retryTimes = 3;

            while (result < 0 && retryTimes > 0)
            {
                try
                {
                    Precursor precursor = spectrum.precursors[0];
                    result = Double.Parse(precursor.isolationWindow.cvParamChild(cvid).value.ToString());
                }
                catch (FormatException e)
                {
                    jobInfo.log(cvid + "-重试次数-" + retryTimes + "-Result:" + result);
                    jobInfo.log(e.StackTrace);
                }
                retryTimes--;
            }

            if (result < 0)
            {
                throw new Exception("Parse Double Error:" + result);
            }
            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pCVID">Term enum identifier</param>
 /// <param name="pCVRef">term parent CV</param>
 /// <param name="pId">term identifier</param>
 /// <param name="pName">term name</param>
 /// <param name="pDef">term definition</param>
 /// <param name="pIsObs">if the term is marked obsolete</param>
 public TermInfo(CVID pCVID, string pCVRef, string pId, string pName, string pDef, bool pIsObs)
 {
     Cvid       = pCVID;
     CVRef      = pCVRef;
     Id         = pId;
     Name       = pName;
     Definition = pDef;
     IsObsolete = pIsObs;
 }
Exemplo n.º 3
0
        public async Task <IActionResult> setMainCV([FromBody] CVID cvID)
        {
            var ID = Guid.Parse(cvID.CvID);
            int rs = await _cvService.setMainCV(ID);

            if (rs == 1)
            {
                return(Ok(new BaseResponse(200, "Đặt CV chính thành công")));
            }
            else
            {
                return(Ok(new BaseResponse(200, "CV đang được chọn là CV chính")));
            }
        }
Exemplo n.º 4
0
        private void initializeGridView(CVID nativeIdFormat)
        {
            // force handle creation
            IntPtr dummy = gridView.Handle;

            spectrumList = new Dictionary <int, MassSpectrum>();

            this.nativeIdFormat = nativeIdFormat;
            if ((nativeIdFormat != CVID.CVID_Unknown) && (nativeIdFormat != CVID.MS_no_nativeID_format))
            {
                string   nativeIdDefinition = new CVTermInfo(nativeIdFormat).def.Replace("Native format defined by ", "");
                string[] nameValuePairs     = nativeIdDefinition.Split(" ".ToCharArray());
                for (int i = 0; i < nameValuePairs.Length; ++i)
                {
                    string[]           nameValuePair = nameValuePairs[i].Split("=".ToCharArray());
                    DataGridViewColumn nameColumn    = new DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn();
                    nameColumn.Name             = nameValuePair[0] + "NativeIdColumn";
                    nameColumn.HeaderText       = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(nameValuePair[0]);
                    nameColumn.DataPropertyName = nameValuePair[0];
                    gridView.Columns.Insert(1 + i, nameColumn);
                    string type = null;
                    if (nameValuePair[0] == "file" || nameValuePair[1] == "xsd:string")
                    {
                        type = "System.String";
                    }
                    else
                    {
                        type = "System.Int32";
                    }
                    spectrumDataSet.SpectrumTable.Columns.Add(nameValuePair[0], Type.GetType(type));
                }
            }

            gridView.Columns["SpectrumType"].ToolTipText      = new CVTermInfo(CVID.MS_spectrum_type).def;
            gridView.Columns["MsLevel"].ToolTipText           = new CVTermInfo(CVID.MS_ms_level).def;
            gridView.Columns["ScanTime"].ToolTipText          = new CVTermInfo(CVID.MS_scan_start_time).def;
            gridView.Columns["BasePeakMz"].ToolTipText        = new CVTermInfo(CVID.MS_base_peak_m_z).def;
            gridView.Columns["BasePeakIntensity"].ToolTipText = new CVTermInfo(CVID.MS_base_peak_intensity).def;
            gridView.Columns["TotalIonCurrent"].ToolTipText   = new CVTermInfo(CVID.MS_total_ion_current).def;

            gridView.Columns["ScanTime"].HeaderText += Properties.Settings.Default.TimeInMinutes ? " (min)" : " (sec)";

            gridView.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(gridView_DataBindingComplete);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Returns true if child has an IsA relationship with parent
        /// </summary>
        /// <param name="child"></param>
        /// <param name="parent"></param>
        /// <returns></returns>
        public static bool CvidIsA(CVID child, CVID parent)
        {
            if (!RelationsIsA.ContainsKey(child))
            {
                return(false);
            }
            var relList = RelationsIsA[child];

            if (relList.Contains(parent))
            {
                return(true);
            }
            // Dig deeper - check grandparents, etc.
            foreach (var ancestor in RelationsIsA[child])
            {
                if (CvidIsA(ancestor, parent))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 6
0
		private void initializeGridView( CVID nativeIdFormat )
		{
            // force handle creation
            IntPtr dummy = gridView.Handle;
            spectrumList = new Dictionary<int, MassSpectrum>();

            this.nativeIdFormat = nativeIdFormat;
            if ((nativeIdFormat != CVID.CVID_Unknown) && (nativeIdFormat != CVID.MS_no_nativeID_format))
            {
                string nativeIdDefinition = new CVTermInfo( nativeIdFormat ).def.Replace("Native format defined by ", "");
                string[] nameValuePairs = nativeIdDefinition.Split( " ".ToCharArray() );
                for( int i = 0; i < nameValuePairs.Length; ++i )
                {
                    string[] nameValuePair = nameValuePairs[i].Split( "=".ToCharArray() );
                    DataGridViewColumn nameColumn = new DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn();
                    nameColumn.Name = nameValuePair[0];
                    nameColumn.HeaderText = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase( nameValuePair[0] );
                    nameColumn.DataPropertyName = nameValuePair[0];
                    gridView.Columns.Insert( 1 + i, nameColumn );
                    string type = null;
                    if( nameValuePair[0] == "file" )
                        type = "System.String";
                    else
                        type = "System.Int32";
                    spectrumDataSet.SpectrumTable.Columns.Add( nameValuePair[0], Type.GetType( type ) );
                }
            }

            gridView.Columns["SpectrumType"].ToolTipText = new CVTermInfo(CVID.MS_spectrum_type).def;
            gridView.Columns["MsLevel"].ToolTipText = new CVTermInfo( CVID.MS_ms_level ).def;
            gridView.Columns["ScanTime"].ToolTipText = new CVTermInfo( CVID.MS_scan_start_time ).def;
            gridView.Columns["BasePeakMz"].ToolTipText = new CVTermInfo( CVID.MS_base_peak_m_z ).def;
            gridView.Columns["BasePeakIntensity"].ToolTipText = new CVTermInfo( CVID.MS_base_peak_intensity ).def;
            gridView.Columns["TotalIonCurrent"].ToolTipText = new CVTermInfo( CVID.MS_total_ion_current ).def;

            gridView.DataBindingComplete += new DataGridViewBindingCompleteEventHandler( gridView_DataBindingComplete );
        }
Exemplo n.º 7
0
        public SpectrumListForm(CVID nativeIdFormat)
        {
            InitializeComponent();

            initializeGridView(nativeIdFormat);
        }
Exemplo n.º 8
0
        public SpectrumListForm( CVID nativeIdFormat )
		{
			InitializeComponent();

            initializeGridView( nativeIdFormat );
		}
Exemplo n.º 9
0
 private static double? GetIsolationWindowValue(Precursor precursor, CVID cvid)
 {
     var term = precursor.isolationWindow.cvParam(cvid);
     if (!term.empty())
         return term.value;
     return null;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Returns true if this term has an IsA relationship with parent
 /// </summary>
 /// <param name="parent"></param>
 public bool IsA(CVID parent)
 {
     return(CvidIsA(Cvid, parent));
 }