These functions report the annotation status of the vertices of a given network, modify or remove certain annotations.

getAttrStatus(graph, pattern = "^miriam.")

getAttrNames(graph, pattern = "")

getAttribute(graph, attr.name)

setAttribute(graph, attr.name, attr.value)

rmAttribute(graph, attr.name)

Arguments

graph

An annotated igraph object.

pattern

A regex experssion representing attribute name pattern.

attr.name

The attribute name

attr.value

A list of attribute values. This must be the same size as the number of vertices.

Value

For getAttrStatus, a dataframe summarizing the number of vertices with no (missing), one (single) or more than one (complex) attribute value. The coverage

For getAttrNames, a character vector of attribute names matching the pattern.

For getAttribute, a list of vertex annotation values for the query attribute.

For setAttribute, a graph with the new attribute set.

For rmAttrNames, a new igraph object with the attibute removed.

Details

NetPathMiner stores all its vertex annotation attributes in a list, and stores them collectively as a single attr. This is not to interfer with graph_attr_names from igraph package. All functions here target NetPathMiner annotations only.

See also

Other Attribute handling methods: stdAttrNames()

Author

Ahmed Mohamed

Examples

 data(ex_kgml_sig)  # Ras and chemokine signaling pathways in human

 # Get status of attribute "pathway" only
 getAttrStatus(ex_kgml_sig, "^pathway$")
#> This graph was created by an old(er) igraph version.
#>  Call `igraph::upgrade_graph()` on it to use with the current igraph version.
#> For now we convert it on the fly...
#>         missing single complex coverage.pct
#> pathway       0     90      18          100

 # Get status of all attributes  starting with "pathway" and "miriam" keywords
 getAttrStatus(ex_kgml_sig, "(^miriam)|(^pathway)")
#>                      missing single complex coverage.pct
#> miriam.kegg.genes          7     49      52           94
#> miriam.ncbigene            7     49      52           94
#> miriam.kegg.pathway        0     90      18          100
#> pathway                    0     90      18          100
#> miriam.kegg.compound     101      7       0            6

 # Get all attribute names containing "miriam"
 getAttrNames(ex_kgml_sig, "miriam")
#> [1] "miriam.kegg.genes"    "miriam.ncbigene"      "miriam.kegg.pathway" 
#> [4] "miriam.kegg.compound"
 # Get all attribute names containing "miriam"
 getAttribute(ex_kgml_sig, "miriam.ncbigene")
#> [[1]]
#>  [1] "1435"  "1942"  "1943"  "1944"  "1945"  "1946"  "1950"  "2246"  "2247" 
#> [10] "2248"  "2249"  "2250"  "2251"  "2252"  "2253"  "2254"  "2255"  "2256" 
#> [19] "2257"  "2258"  "2259"  "2277"  "26281" "26291" "27006" "284"   "285"  
#> [28] "3082"  "3479"  "3630"  "4254"  "4803"  "51378" "5154"  "5155"  "5228" 
#> [37] "56034" "7422"  "7423"  "7424"  "80310" "8074"  "8817"  "8822"  "8823" 
#> [46] "9965" 
#> 
#> [[2]]
#>  [1] "1436" "1956" "1969" "2260" "2261" "2263" "2264" "2321" "2324" "3480"
#> [11] "3643" "3791" "3815" "4233" "4804" "5156" "5159" "7010"
#> 
#> [[3]]
#> [1] "25759"  "399694" "53358"  "6464"  
#> 
#> [[4]]
#> [1] "2885"
#> 
#> [[5]]
#> [1] "2549" "9846"
#> 
#> [[6]]
#> [1] "5781"
#> 
#> [[7]]
#> [1] "6654" "6655"
#> 
#> [[8]]
#> [1] "22800" "22808" "3265"  "3845"  "4893"  "6237" 
#> 
#> [[9]]
#> [1] "7535"
#> 
#> [[10]]
#> [1] "27040"
#> 
#> [[11]]
#> [1] "5335" "5336"
#> 
#> [[12]]
#> NULL
#> 
#> [[13]]
#> [1] "10125"  "10235"  "115727" "25780" 
#> 
#> [[14]]
#> [1] "3363"
#> 
#> [[15]]
#>  [1] "10681"  "2782"   "2783"   "2784"   "2785"   "2786"   "2787"   "2788"  
#>  [9] "2790"   "2791"   "2792"   "2793"   "51764"  "54331"  "55970"  "59345" 
#> [17] "648044" "94235" 
#> 
#> [[16]]
#> [1] "5923" "5924"
#> 
#> [[17]]
#> NULL
#> 
#> [[18]]
#> NULL
#> 
#> [[19]]
#> [1] "5566" "5567" "5568" "5613"
#> 
#> [[20]]
#> [1] "163688" "51806"  "801"    "805"    "808"    "810"   
#> 
#> [[21]]
#> NULL
#> 
#> [[22]]
#> NULL
#> 
#> [[23]]
#> [1] "4763"
#> 
#> [[24]]
#> [1] "100271927" "10156"     "22821"     "5921"      "5922"      "64926"    
#> [7] "8437"      "8831"      "9462"     
#> 
#> [[25]]
#> [1] "11186"
#> 
#> [[26]]
#> [1] "6789"
#> 
#> [[27]]
#> [1] "83593"
#> 
#> [[28]]
#> [1] "7074"
#> 
#> [[29]]
#> [1] "23533" "5290"  "5291"  "5293"  "5294"  "5295"  "5296"  "8503" 
#> 
#> [[30]]
#> [1] "4301"
#> 
#> [[31]]
#> [1] "5894"
#> 
#> [[32]]
#> [1] "5900"
#> 
#> [[33]]
#> [1] "23179"
#> 
#> [[34]]
#> [1] "5863"
#> 
#> [[35]]
#> [1] "51196"
#> 
#> [[36]]
#> [1] "9610"
#> 
#> [[37]]
#> [1] "10928"
#> 
#> [[38]]
#> [1] "8315"
#> 
#> [[39]]
#> [1] "9771"
#> 
#> [[40]]
#> [1] "5879" "5880" "5881"
#> 
#> [[41]]
#> [1] "10298" "5058"  "5062"  "5063"  "56924" "57144"
#> 
#> [[42]]
#> [1] "387"
#> 
#> [[43]]
#> NULL
#> 
#> [[44]]
#> [1] "10000" "207"   "208"  
#> 
#> [[45]]
#> [1] "1147" "3551" "8517"
#> 
#> [[46]]
#> [1] "4790" "5970"
#> 
#> [[47]]
#> [1] "572"
#> 
#> [[48]]
#> [1] "598"
#> 
#> [[49]]
#> [1] "4303"
#> 
#> [[50]]
#> [1] "356"
#> 
#> [[51]]
#> [1] "5604" "5605"
#> 
#> [[52]]
#> [1] "5594" "5595"
#> 
#> [[53]]
#>  [1] "100137049" "11145"     "123745"    "255189"    "26279"     "283748"   
#>  [7] "30814"     "391013"    "50487"     "51365"     "5319"      "5320"     
#> [13] "5321"      "5322"      "64600"     "81579"     "8398"      "8399"     
#> [19] "84647"     "8605"      "8681"     
#> 
#> [[54]]
#> [1] "2002"
#> 
#> [[55]]
#> [1] "2113" "2114"
#> 
#> [[56]]
#> [1] "8844"
#> 
#> [[57]]
#> [1] "5906" "5908"
#> 
#> [[58]]
#> [1] "5898" "5899"
#> 
#> [[59]]
#> [1] "5599" "5601" "5602"
#> 
#> [[60]]
#> [1] "55770"
#> 
#> [[61]]
#> [1] "29110"
#> 
#> [[62]]
#> [1] "5966"
#> 
#> [[63]]
#> [1] "5337" "5338"
#> 
#> [[64]]
#> [1] "998"
#> 
#> [[65]]
#> [1] "5578" "5579" "5582"
#> 
#> [[66]]
#> [1] "25" "27"
#> 
#> [[67]]
#> [1] "5868" "5869" "5878"
#> 
#> [[68]]
#> [1] "382"
#> 
#> [[69]]
#> [1] "5879"
#> 
#> [[70]]
#> [1] "6654"
#> 
#> [[71]]
#> [1] "3265" "3845" "4893"
#> 
#> [[72]]
#> [1] "22808"
#> 
#> [[73]]
#> [1] "5923"
#> 
#> [[74]]
#> [1] "6237"
#> 
#> [[75]]
#> NULL
#> 
#> [[76]]
#>  [1] "10344"  "10563"  "10850"  "2919"   "2920"   "2921"   "3576"   "3627"  
#>  [9] "388372" "414062" "4283"   "5196"   "5197"   "5473"   "56477"  "58191" 
#> [17] "6346"   "6347"   "6348"   "6349"   "6351"   "6352"   "6354"   "6355"  
#> [25] "6356"   "6357"   "6358"   "6359"   "6360"   "6361"   "6362"   "6363"  
#> [33] "6364"   "6366"   "6367"   "6368"   "6369"   "6370"   "6372"   "6373"  
#> [41] "6374"   "6375"   "6376"   "6387"   "6846"   "9547"   "9560"  
#> 
#> [[77]]
#>  [1] "10663"  "10803"  "1230"   "1232"   "1233"   "1234"   "1235"   "1236"  
#>  [9] "1237"   "1524"   "2826"   "2829"   "2833"   "3577"   "3579"   "643"   
#> [17] "729230" "7852"  
#> 
#> [[78]]
#> [1] "3717" "3718"
#> 
#> [[79]]
#> [1] "6772" "6773" "6774" "6777"
#> 
#> [[80]]
#> [1] "2770" "2771" "2773"
#> 
#> [[81]]
#> [1] "107"    "108"    "109"    "111"    "112"    "113"    "114"    "115"   
#> [9] "196883"
#> 
#> [[82]]
#> [1] "2268" "3055" "4067" "6714"
#> 
#> [[83]]
#> [1] "5894" "673" 
#> 
#> [[84]]
#> [1] "5604"
#> 
#> [[85]]
#> [1] "5590"
#> 
#> [[86]]
#> [1] "4792" "4793"
#> 
#> [[87]]
#> [1] "2931" "2932"
#> 
#> [[88]]
#> [1] "3702"
#> 
#> [[89]]
#> [1] "10451" "7409"  "7410" 
#> 
#> [[90]]
#> [1] "5879" "5880"
#> 
#> [[91]]
#> [1] "5058"
#> 
#> [[92]]
#> [1] "7454" "8976"
#> 
#> [[93]]
#> [1] "6093" "9475"
#> 
#> [[94]]
#> [1] "57580"
#> 
#> [[95]]
#> [1] ""     "9844" "1794"
#> 
#> [[96]]
#> [1] "2185"
#> 
#> [[97]]
#> [1] "5829"
#> 
#> [[98]]
#> [1] "1398" "1399"
#> 
#> [[99]]
#> [1] "5747"
#> 
#> [[100]]
#> [1] "9564"
#> 
#> [[101]]
#> [1] "23236" "5330"  "5331"  "5332" 
#> 
#> [[102]]
#> [1] "10235"
#> 
#> [[103]]
#> [1] ""      "56288" "5590"  "7074" 
#> 
#> [[104]]
#> [1] "5579" "5580"
#> 
#> [[105]]
#> [1] "653361"
#> 
#> [[106]]
#> [1] "408" "409"
#> 
#> [[107]]
#> [1] "131890" "156"    "157"    "2868"   "2869"   "2870"   "6011"  
#> 
#> [[108]]
#> [1] "2309"
#> 

 # Remove an attribute from graph
 graph <- rmAttribute(ex_kgml_sig, "miriam.ncbigene")