/// <summary> /// Helper method for including an additional analysis software to the list /// </summary> public void AddAnalysisSoftware( string id, string name, string version, string uri, string cv, string accession, string customizations ) { AnalysisSoftwareType sw = new AnalysisSoftwareType(); sw.id = id; sw.name = name; sw.version = version; sw.uri = uri; if( cv != null && accession != null ) { CVParamType p = new CVParamType(); p.cvRef = cv; p.accession = accession; p.name = name; sw.SoftwareName.Item = p; } if( customizations != null ) sw.Customizations = customizations; ListSW.Add( sw ); }
/// <summary> /// Save results to a mzIdentML file /// </summary> public void SaveMzid( string fpath ) { if( m_mzid == null || m_InputFiles.Count > 1 ) return; #region Organization OrganizationType org = new OrganizationType(); org.id = "UPV/EHU"; org.name = "University of the Basque Country"; foreach( OrganizationType o in m_mzid.ListOrganizations ) if( o.id == org.id ) { m_mzid.ListOrganizations.Remove( o ); break; } CVParamType url = new CVParamType(); url.accession = "MS:1000588"; url.name = "contact URL"; url.cvRef = "PSI-MS"; url.value = "http://www.ehu.es"; org.Item = url; m_mzid.ListOrganizations.Add( org ); #endregion #region Software author PersonType person = new PersonType(); person.id = "PAnalyzer_Author"; person.firstName = "Gorka"; person.lastName = "Prieto"; CVParamType email = new CVParamType(); email.accession = "MS:1000589"; email.name = "contact email"; email.cvRef = "PSI-MS"; email.value = "*****@*****.**"; //person.Items.Add(email); person.Item = email; AffiliationType aff = new AffiliationType(); aff.organization_ref = org.id; //person.Affiliation.Add(aff); person.Affiliation = new AffiliationType[]{aff}; foreach( PersonType p in m_mzid.ListPeople ) if( p.id == person.id ) { m_mzid.ListPeople.Remove( p ); break; } m_mzid.ListPeople.Add( person ); #endregion #region Analysis software AnalysisSoftwareType sw = new AnalysisSoftwareType(); sw.id = m_Software.Name; sw.name = m_Software.ToString(); sw.uri = m_Software.Url; sw.version = m_Software.Version; CVParamType swname = new CVParamType(); swname.name = "PAnalyzer"; swname.cvRef = "PSI-MS"; swname.accession = "MS:1002076"; sw.SoftwareName = new ParamType(); sw.SoftwareName.Item = swname; RoleType role = new RoleType(); CVParamType contacttype = new CVParamType(); contacttype.accession = "MS:1001271"; contacttype.cvRef = "PSI-MS"; contacttype.name = "researcher"; role.cvParam = contacttype; sw.ContactRole = new ContactRoleType(); sw.ContactRole.contact_ref = person.id; sw.ContactRole.Role = role; sw.Customizations = m_Software.Customizations; AnalysisSoftwareType old = null; foreach( AnalysisSoftwareType s in m_mzid.ListSW ) if( s.id == m_Software.Name ) { old = s; break; } if( old != null ) m_mzid.ListSW.Remove(old); m_mzid.ListSW.Add( sw ); #endregion #region Protein detection protocol if( m_mzid.Data.AnalysisCollection.ProteinDetection == null || m_mzid.Data.AnalysisProtocolCollection.ProteinDetectionProtocol == null ) return; m_mzid.Data.AnalysisCollection.ProteinDetection.proteinDetectionList_ref = "PDL_PAnalyzer"; m_mzid.Data.AnalysisCollection.ProteinDetection.proteinDetectionProtocol_ref = "PDP_PAnalyzer"; m_mzid.Data.AnalysisProtocolCollection.ProteinDetectionProtocol.analysisSoftware_ref = sw.id; m_mzid.Data.AnalysisProtocolCollection.ProteinDetectionProtocol.id = "PDP_PAnalyzer"; #endregion #region Protein detection list m_mzid.Data.DataCollection.AnalysisData.ProteinDetectionList.id = "PDL_PAnalyzer"; List<ProteinAmbiguityGroupType> groups = BuildProteinDetectionList(); m_mzid.Data.DataCollection.AnalysisData.ProteinDetectionList.ProteinAmbiguityGroup = groups.ToArray(); #endregion #region References BibliographicReferenceType pa = new BibliographicReferenceType(); pa.authors = "Gorka Prieto, Kerman Aloria, Nerea Osinalde, Asier Fullaondo, Jesus M. Arizmendi and Rune Matthiesen"; pa.id = pa.doi = "10.1186/1471-2105-13-288"; pa.issue = "288"; pa.name = pa.title = "PAnalyzer: A software tool for protein inference in shotgun proteomics"; pa.publication = "BMC Bioinformatics"; pa.publisher = "BioMed Central Ltd."; pa.volume = "13"; pa.year = 2012; List<BibliographicReferenceType> refs = new List<BibliographicReferenceType>(); refs.Add( pa ); if( m_mzid.Data.BibliographicReference != null ) foreach( BibliographicReferenceType r in m_mzid.Data.BibliographicReference ) { if( r.doi != null && r.doi == pa.doi ) continue; refs.Add( r ); } m_mzid.Data.BibliographicReference = refs.ToArray(); #endregion m_mzid.Save( fpath ); Notify( "Saved to " + fpath ); }