Mercurial > repos > prog > lcmsmatching
annotate NcbigeneEntry.R @ 2:20d69a062da3 draft
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
author | prog |
---|---|
date | Thu, 02 Mar 2017 08:55:00 -0500 |
parents | |
children |
rev | line source |
---|---|
2
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
1 ##################### |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
2 # CLASS DECLARATION # |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
3 ##################### |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
4 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
5 NcbigeneEntry <- methods::setRefClass("NcbigeneEntry", contains = "BiodbEntry") |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
6 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
7 ########### |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
8 # FACTORY # |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
9 ########### |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
10 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
11 createNcbigeneEntryFromXml <- function(contents, drop = TRUE) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
12 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
13 entries <- list() |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
14 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
15 # Define xpath expressions |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
16 xpath.expr <- character() |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
17 xpath.expr[[BIODB.ACCESSION]] <- "//Gene-track_geneid" |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
18 xpath.expr[[BIODB.KEGG.ID]] <- "/Dbtag_db[text()='KEGG']/..//Object-id_str" |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
19 xpath.expr[[BIODB.UNIPROT.ID]] <- "//Gene-commentary_heading[text()='UniProtKB']/..//Dbtag_db[text()='UniProtKB/Swiss-Prot']/..//Object-id_str" |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
20 xpath.expr[[BIODB.LOCATION]] <- "//Gene-ref_maploc" |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
21 xpath.expr[[BIODB.PROTEIN.DESCRIPTION]] <- "//Gene-ref_desc" |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
22 xpath.expr[[BIODB.SYMBOL]] <- "//Gene-ref_locus" |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
23 xpath.expr[[BIODB.SYNONYMS]] <- "//Gene-ref_syn_E" |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
24 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
25 for (content in contents) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
26 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
27 # Create instance |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
28 entry <- NcbigeneEntry$new() |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
29 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
30 # Parse HTML |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
31 xml <- XML::xmlInternalTreeParse(content, asText = TRUE) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
32 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
33 # An error occured |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
34 if (length(XML::getNodeSet(xml, "//Error")) == 0 && length(XML::getNodeSet(xml, "//ERROR")) == 0) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
35 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
36 # Test generic xpath expressions |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
37 for (field in names(xpath.expr)) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
38 v <- XML::xpathSApply(xml, xpath.expr[[field]], XML::xmlValue) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
39 if (length(v) > 0) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
40 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
41 # Eliminate duplicates |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
42 v <- v[ ! duplicated(v)] |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
43 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
44 # Set field |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
45 entry$setField(field, v) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
46 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
47 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
48 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
49 # CCDS ID |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
50 ccdsid <- .find.ccds.id(xml) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
51 if ( ! is.na(ccdsid)) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
52 entry$setField(BIODB.NCBI.CCDS.ID, ccdsid) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
53 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
54 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
55 entries <- c(entries, entry) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
56 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
57 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
58 # Replace elements with no accession id by NULL |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
59 entries <- lapply(entries, function(x) if (is.na(x$getField(BIODB.ACCESSION))) NULL else x) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
60 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
61 # If the input was a single element, then output a single object |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
62 if (drop && length(contents) == 1) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
63 entries <- entries[[1]] |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
64 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
65 return(entries) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
66 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
67 # Get data |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
68 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
69 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
70 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
71 ################ |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
72 # FIND CCDS ID # |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
73 ################ |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
74 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
75 .find.ccds.id <- function(xml) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
76 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
77 # 1) Get all CCDS tags. |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
78 ccds_elements <- XML::getNodeSet(xml, "//Dbtag_db[text()='CCDS']/..//Object-id_str") |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
79 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
80 # 2) If all CCDS are the same, go to point 4. |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
81 ccds <- NA_character_ |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
82 for (e in ccds_elements) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
83 current_ccds <- XML::xmlValue(e) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
84 if (is.na(ccds)) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
85 ccds <- current_ccds |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
86 else { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
87 if (current_ccds != ccds) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
88 ccds <- NA_character_ |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
89 break |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
90 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
91 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
92 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
93 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
94 # 3) There are several CCDS values, we need to find the best one (i.e.: the most current one). |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
95 if (is.na(ccds)) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
96 # For each CCDS, look for the parent Gene-commentary tag. Then look for the text content of the Gene-commentary_label which is situed under. Ignore CCDS that have no Gene-commentary_label associated. Choose the CCDS that has the smallest Gene-commentary_label in alphabetical order. |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
97 version <- NA_character_ |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
98 for (e in ccds_elements) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
99 versions <- XML::xpathSApply(e, "ancestor::Gene-commentary/Gene-commentary_label", XML::xmlValue) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
100 if (length(versions) < 1) next |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
101 current_version <- versions[[length(versions)]] |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
102 if (is.na(version) || current_version < version) { |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
103 version <- current_version |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
104 ccds <- XML::xmlValue(e) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
105 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
106 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
107 } |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
108 |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
109 return(ccds) |
20d69a062da3
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
prog
parents:
diff
changeset
|
110 } |