Endpoint returns presumably cloud config - spring-mvc

I have this simple controller
#RestController
#RequestMapping("/metrics")
public class MetricsController {
#GetMapping
#ApiOperation("Get metrics by source")
public ResponseEntity<List<Metric>> getMetricBySource(#RequestParam String source) {
if (source.equalsIgnoreCase("recordings")) {
return new ResponseEntity<>(MetricsConstants.RECORDINGS_METRICS, HttpStatus.OK);
} else if (source.equalsIgnoreCase("advertisers")) {
return new ResponseEntity<>(MetricsConstants.ADVERTISERS_METRICS, HttpStatus.OK);
} else if (source.equalsIgnoreCase("publishers")) {
return new ResponseEntity<>(MetricsConstants.PUBLISHERS_METRICS, HttpStatus.OK);
} else if (source.equalsIgnoreCase("partners")) {
return new ResponseEntity<>(MetricsConstants.PARTNERS_METRICS, HttpStatus.OK);
} else if (source.equalsIgnoreCase("products")) {
return new ResponseEntity<>(MetricsConstants.PRODUCTS_METRICS, HttpStatus.OK);
} else if (source.equalsIgnoreCase("regular-users")) {
return new ResponseEntity<>(MetricsConstants.REGULAR_USERS_METRICS, HttpStatus.OK);
}
return null;
}
}
Now, when I'm trying to access the endpoint via
localhost:8099/metrics?source=advertisers
I'm getting the following response
{
"mem": 947258,
"mem.free": 367038,
"processors": 4,
"instance.uptime": 540532,
"uptime": 556754,
"systemload.average": -1,
"heap.committed": 854016,
"heap.init": 260096,
"heap.used": 486977,
"heap": 3699200,
"nonheap.committed": 95312,
"nonheap.init": 2496,
"nonheap.used": 93242,
"nonheap": 0,
"threads.peak": 61,
"threads.daemon": 37,
"threads.totalStarted": 128,
"threads": 53,
"classes": 13916,
"classes.loaded": 13916,
"classes.unloaded": 0,
"gc.ps_scavenge.count": 13,
"gc.ps_scavenge.time": 150,
"gc.ps_marksweep.count": 3,
"gc.ps_marksweep.time": 341,
"counter.servo.eurekaclient.transport.request": 0,
"counter.servo.eurekaclient.transport.connectionerrors": 0,
"counter.servo.timeouts": 0,
"counter.servo.rejectedexecutions": 0,
"counter.servo.throwables": 0,
"gauge.servo.threadpoolused": 0,
"gauge.servo.response.metrics": 6,
"normalized.servo.rest.totaltime": 0,
"normalized.servo.rest.count": 0,
"gauge.servo.rest.min": 0,
"gauge.servo.rest.max": 0,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00030": 0,
"counter.servo.discoveryclient-httpclient_reuse": 10,
"counter.servo.discoveryclient-httpclient_createnew": 26,
"counter.servo.discoveryclient-httpclient_request": 36,
"counter.servo.discoveryclient-httpclient_release": 36,
"counter.servo.discoveryclient-httpclient_delete": 24,
"normalized.servo.discoveryclient-httpclient_requestconnectiontimer.totaltime":
0.005046033333333333,
"normalized.servo.discoveryclient-httpclient_requestconnectiontimer.count":
0.06666666666666667,
"gauge.servo.discoveryclient-httpclient_requestconnectiontimer.min":
0.017749,
"gauge.servo.discoveryclient-httpclient_requestconnectiontimer.max":
0.12356299999999999,
"normalized.servo.discoveryclient-httpclient_createconnectiontimer.totaltime":
0.0012743166666666665,
"normalized.servo.discoveryclient-httpclient_createconnectiontimer.count":
0.05,
"gauge.servo.discoveryclient-httpclient_createconnectiontimer.min":
0.012288,
"gauge.servo.discoveryclient-httpclient_createconnectiontimer.max":
0.034475,
"gauge.servo.connectioncount": 2,
"normalized.servo.eurekaclient.transport.latency.totaltime": 0,
"normalized.servo.eurekaclient.transport.latency.count": 0,
"gauge.servo.eurekaclient.transport.latency.min": 0,
"gauge.servo.eurekaclient.transport.latency.max": 0,
"gauge.servo.response.star-star.favicon.ico": 42,
"gauge.servo.eurekaclient.registry.lastupdatesec_00240": 0,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00015": 1,
"gauge.servo.response.webjars.star-star": 5,
"gauge.servo.eurekaclient.resolver.endpointssize": 1,
"gauge.servo.eurekaclient.resolver.lastloadtimestamp": 233376,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00240": 0,
"gauge.servo.eurekaclient.transport.quarantinesize": 0,
"gauge.servo.eurekaclient.registry.lastupdatesec_00030": 0,
"gauge.servo.response.v2.api-docs": 126,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00480": 0,
"gauge.servo.eurekaclient.registry.lastupdatesec_00480": 0,
"gauge.servo.response.star-star": 13,
"gauge.servo.response.swagger-resources.configuration.ui": 19,
"normalized.servo.eureka-connection-cleaner-time.totaltime": 0.0009386666666666665,
"normalized.servo.eureka-connection-cleaner-time.count": 0.03333333333333333,
"gauge.servo.eureka-connection-cleaner-time.min": 0.021162,
"gauge.servo.eureka-connection-cleaner-time.max": 0.035158,
"counter.servo.eureka-connection-cleaner-failure": 0,
"gauge.servo.eurekaclient.transport.currentsessionduration": 533378,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00120": 0,
"gauge.servo.eurekaclient.registry.lastupdatesec_00015": 1,
"gauge.servo.response.swagger-resources.configuration.security": 4,
"gauge.servo.eurekaclient.registry.lastupdatesec_00120": 0,
"gauge.servo.response.info": 35,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00060": 0,
"gauge.servo.eurekaclient.registry.lastupdatesec_00060": 0,
"counter.servo.discoveryclient_reconcilehashcodemismatch": 0,
"normalized.servo.discoveryclient_fetchregistry.totaltime": 0.29706815000000003,
"normalized.servo.discoveryclient_fetchregistry.count": 0.03333333333333333,
"gauge.servo.discoveryclient_fetchregistry.min": 4.337664999999999,
"gauge.servo.discoveryclient_fetchregistry.max": 13.486424,
"counter.servo.discoveryclient_reregister": 0,
"gauge.servo.eurekaclient.registry.localregistrysize": 5,
"gauge.servo.eurekaclient.registry.lastsuccessfulregistryfetchtimeperiod":
22920,
"gauge.servo.eurekaclient.registration.lastsuccessfulheartbeattimeperiod":
22926,
"gauge.servo.response.swagger-resources": 5,
"integration.channel.errorChannel.errorRate.mean": 0,
"integration.channel.errorChannel.errorRate.max": 0,
"integration.channel.errorChannel.errorRate.min": 0,
"integration.channel.errorChannel.errorRate.stdev": 0,
"integration.channel.errorChannel.errorRate.count": 0,
"integration.channel.errorChannel.sendCount": 0,
"integration.channel.errorChannel.sendRate.mean": 0,
"integration.channel.errorChannel.sendRate.max": 0,
"integration.channel.errorChannel.sendRate.min": 0,
"integration.channel.errorChannel.sendRate.stdev": 0,
"integration.channel.errorChannel.sendRate.count": 0,
"integration.channel.springCloudBusInput.errorRate.mean": 0,
"integration.channel.springCloudBusInput.errorRate.max": 0,
"integration.channel.springCloudBusInput.errorRate.min": 0,
"integration.channel.springCloudBusInput.errorRate.stdev": 0,
"integration.channel.springCloudBusInput.errorRate.count": 0,
"integration.channel.springCloudBusInput.sendCount": 0,
"integration.channel.springCloudBusInput.sendRate.mean": 0,
"integration.channel.springCloudBusInput.sendRate.max": 0,
"integration.channel.springCloudBusInput.sendRate.min": 0,
"integration.channel.springCloudBusInput.sendRate.stdev": 0,
"integration.channel.springCloudBusInput.sendRate.count": 0,
"integration.channel.hystrixStreamOutput.errorRate.mean": 0,
"integration.channel.hystrixStreamOutput.errorRate.max": 0,
"integration.channel.hystrixStreamOutput.errorRate.min": 0,
"integration.channel.hystrixStreamOutput.errorRate.stdev": 0,
"integration.channel.hystrixStreamOutput.errorRate.count": 0,
"integration.channel.hystrixStreamOutput.sendCount": 0,
"integration.channel.hystrixStreamOutput.sendRate.mean": 0,
"integration.channel.hystrixStreamOutput.sendRate.max": 0,
"integration.channel.hystrixStreamOutput.sendRate.min": 0,
"integration.channel.hystrixStreamOutput.sendRate.stdev": 0,
"integration.channel.hystrixStreamOutput.sendRate.count": 0,
"integration.channel.nullChannel.errorRate.mean": 0,
"integration.channel.nullChannel.errorRate.max": 0,
"integration.channel.nullChannel.errorRate.min": 0,
"integration.channel.nullChannel.errorRate.stdev": 0,
"integration.channel.nullChannel.errorRate.count": 0,
"integration.channel.nullChannel.sendCount": 0,
"integration.channel.nullChannel.sendRate.mean": 0,
"integration.channel.nullChannel.sendRate.max": 0,
"integration.channel.nullChannel.sendRate.min": 0,
"integration.channel.nullChannel.sendRate.stdev": 0,
"integration.channel.nullChannel.sendRate.count": 0,
"integration.channel.springCloudBusOutput.errorRate.mean": 0,
"integration.channel.springCloudBusOutput.errorRate.max": 0,
"integration.channel.springCloudBusOutput.errorRate.min": 0,
"integration.channel.springCloudBusOutput.errorRate.stdev": 0,
"integration.channel.springCloudBusOutput.errorRate.count": 0,
"integration.channel.springCloudBusOutput.sendCount": 0,
"integration.channel.springCloudBusOutput.sendRate.mean": 0,
"integration.channel.springCloudBusOutput.sendRate.max": 0,
"integration.channel.springCloudBusOutput.sendRate.min": 0,
"integration.channel.springCloudBusOutput.sendRate.stdev": 0,
"integration.channel.springCloudBusOutput.sendRate.count": 0,
"integration.handler._org.springframework.integration.errorLogger.handler.duration.mean":
0,
"integration.handler._org.springframework.integration.errorLogger.handler.duration.max":
0,
"integration.handler._org.springframework.integration.errorLogger.handler.duration.min":
0,
"integration.handler._org.springframework.integration.errorLogger.handler.duration.stdev":
0,
"integration.handler._org.springframework.integration.errorLogger.handler.duration.count":
0,
"integration.handler._org.springframework.integration.errorLogger.handler.activeCount":
0,
"integration.handlerCount": 1,
"integration.channelCount": 5,
"integration.sourceCount": 0,
"httpsessions.max": -1,
"httpsessions.active": 0,
"datasource.primary.active": 0,
"datasource.primary.usage": 0 }
Code flow doesn't even go to the method(tried to use debugger).
The problem with only this newly created endpoint. Last error was
Full authentication is required to access this resource
until I wrote the piece of configuration:
management:
security:
enabled: false
I use
springBootVersion = '1.5.3.RELEASE'
springCloudVersion = 'Dalston.RELEASE'

The issue was with Spring Cloud MetricsInterceptorConfiguration.
As far as I understood, on each endpoint you can add suffix-path /metrics to see the metrics for this endpoint provided by Spring Cloud. So it just intercepted my mapping :)
I solved this by adding the following configuration to bootstrap.yml:
endpoints:
metrics:
enabled: false

Related

What is the most typographically safe way to write a linear program in R?

In R, linear programming using the lpsolve library requires an extensive amount of manually typed values for the needed matrices and vectors for the objective function coefficients, left-hand side coefficients, constraints, etc. Messing up even one value or one comma will make the script error or worse, the program will find a solution but it will be the wrong one due to incorrect setup. For large, real-world problems like network flow, simply typing the program itself is time prohibitive. What am I missing about R's capabilities in this space? Or, is there an alternate tool better fit for the job? Open source preferred due to budget.
Here is an example of the type of code needed in R for a relatively simple optimization problem:
# fleet size optimization, with an added computation of total miles driven
library(lpSolve)
# Objective function coefficients
ObjCoeff<-c(1300, 690, 421.5, 531, 690, 427.50, 277.50, 421.5, 427.50, 303, 531, 277.50, 303,
460, 281, 354, 460, 285, 185, 281, 285, 202, 354, 185, 202, 0)
# Constraint matrix
Amatrix<-matrix(c(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, -1, 0, 0, -1, 0, 0, -1, 0, 0, 1, 1, 1, -1, 0, 0, -1, 0, 0, -1, 0, 0,0,
0, -1,0, 0, 1, 1, 1, 0, -1, 0, 0,-1, 0,-1, 0, 0, 1, 1, 1, 0, -1, 0, 0, -1, 0,0,
0, 0,-1, 0, 0,-1, 0, 1, 1, 1, 0, 0,-1, 0,-1, 0, 0, -1, 0, 1, 1, 1, 0, 0,-1,0,
0, 0, 0, -1, 0, 0,-1, 0, 0,-1, 1, 1, 1, 0, 0,-1, 0, 0,-1, 0, 0,-1, 1, 1, 1,0,
-1300, 460, 281,354,460,285,185,281,285,202,354,185,202,460,281,354, 460, 285,185, 281, 285,202, 354, 185, 202, 0,
0, 460, 281,354,460,285,185,281,285,202,354,185,202,460,281,354, 460, 285,185, 281, 285,202, 354, 185, 202,-1), nrow=18, byrow=TRUE)
# Right hand side constraint vector
Bvector<-c(10, 10, 10, 20, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0,0 )
# Constraint inequality direction vector
constrainttype<- c(">=", ">=",">=", ">=",">=", ">=",">=", ">=",">=", ">=",">=", ">=","=", "=" , "=" , "=" ,"<=", "=" )
# Solve the specified integer program by setting all.int=TRUE
optimum<-lp(direction="min", objective.in=ObjCoeff, const.mat = Amatrix, const.dir = constrainttype, const.rhs = Bvector, all.int =TRUE)
# Print constraint matrix to verify it was specified correctly
print(optimum$constraints)
# Check to see if the solver reached optimality (0 means yes)
print(optimum$status)
# Print values of each variable in the optimal solution
# note that they are all integer valued
print(optimum$solution)
# Print the optimal objective function value
print(optimum$objval)
R has its strengths for sure, but formulation of non-trivial LP's is not one of them.
There are several other open source frameworks that are much more expressive. If you are a python user, you can pick from many including:
pyomo, gekko, cvxpy, pulp, or-tools and others I'm sure.
I'm a fan of pyomo for model building, but it requires installation of a separate solver, which isn't too difficult. There are several open-source free solvers that are excellent and in common use with different capabilities such as cbc, glpk, ipopt and others, and of course many excellent licensed solvers.
If you want to start with an "all in one" the pulp framework includes a solver with the build--I forget which one.
There are many examples on this site for all the pkgs above if you search by tag.

How to merge 2 dataframes with partial character strings?

i have a dataset that lists several possible genera of plants, and another dataset that lists all the species with their functional forms. I would like to merge these datasets in such a way that IF the genus listed in df2 is found within the SPP column of df1, the merged dataframe will include the functional form associated. ie if a sample is listed in df1 as possibly Poa OR Festuca, and df2 lists the functional form of Poa as Graminoid, the resultant merged dataframe would have all of the data from df1 AND an additional column that says "Graminoid." (also including the other columns such as LifeHistory and Origin would also be fine/helpful)
First Dataframe, containing multiple possible species (subset of first 100 rows):
structure(list(SPP = c("Abies", "Acer", "Poa OR Agrostis", "Allium schoenoprasum",
"Alnus", "Amblystegiaceae OR Anomodontaceae OR Pterobryaceae OR Meteoriaceae OR Pterigynandraceae OR Lembophyllaceae OR Hypnum OR Taxiphyllaceae OR Orthostichellaceae OR Hylocomiaceae OR Leucodontaceae OR Miyabeaceae OR Climaciaceae OR Cryphaeaceae OR Calliergonaceae OR Neckeraceae OR Moss",
"Andreaeaceae OR Moss", "Anemone", "Antennaria", "Apocynum cannabinum",
"Aralia OR Ehretiaceae OR Araliaceae", "Arctostaphylos uva-ursi",
"Artemisia", "Asteraceae", "Asteraceae OR Bidens OR Senecio",
"Astragalus", "Aulacomniaceae OR Moss", "Berberis", "Betula",
"Bidens", "Bidens OR Torricelliaceae OR Cornus OR Cardiopteridaceae",
"Boechera", "Boechera OR Arabis", "Boykinia OR Saxifraga", "Brachytheciaceae OR Plagiotheciaceae OR Moss",
"Brickellia", "Bromus", "Bryaceae OR Moss", "Bryaceae OR Mniaceae OR Splachnaceae OR Moss",
"Buxbaumiaceae", "Calamagrostis", "Campanula rotundifolia", "Carex",
"Caryophyllaceae", "Castilleja", "Celastraceae", "Celastraceae OR Paxistima",
"Cerastium", "Chamerion OR Epilobium OR Oenothera", "Chamerion",
"Chrysosplenium", "Claytonia", "Clematis", "Collinsia", "Cornus",
"Cornus OR Phacelia", "Crassulaceae", "Crepis OR Lactuca OR Centaurea OR Tragopogon OR Solidago OR Gutierrezia OR Taraxacum",
"Danthonia californica", "Delphinium geyeri", "Dichanthelium acuminatum OR Dichanthelium oligosanthes OR Panicum capillare",
"Dicranaceae", "Draba", "Dryas OR Purshia", "Echinacea angustifolia OR Eriophyllum lanatum OR Cornus canadensis",
"Elaeagnus commutata", "Elymus OR Agropyron OR Triticum", "Encalyptaceae OR Moss",
"Equisetum", "Ericaceae OR Rhododendron", "Erigeron", "Erigeron",
"Erigeron OR Taraxacum", "Eriogonum", "Erythronium", "Erythronium OR Liliaceae",
"Euphorbia glyptosperma", "Fabaceae", "Festuca", "Fragaria OR Rosa OR Rubus OR Sibbaldia OR Drymocallis OR Comarum OR Potentilla",
"Funariaceae OR Moss", "Galium", "Gaultheria", "Gentiana calycosa",
"Geranium", "Goodyera", "Grimmiaceae OR Moss", "Grimmiaceae OR Mniaceae OR Disceliaceae OR Ditrichaceae OR Drummondiaceae OR Meesiaceae OR Rhacocarpaceae OR Bryaceae OR Moss",
"Gymnomitriaceae OR Liverwort", "Hedysarum", "Hieracium triste",
"Hypericum", "Juncus", "Juniperus communis", "Koeleria macrantha OR Deschampsia cespitosa",
"Lamiaceae", "Liliaceae", "Lomatium bicolor OR Shoshonea pulvinata OR Lomatium macrocarpum OR Musineon divaricatum OR Zizia aptera",
"Lonicera", "Lotus unifoliolatus", "Luzula", "Lycopodium clavatum OR Moss",
"Melica subulata", "Menyanthes trifoliata", "Mertensia", "Micranthes",
"Micranthes OR Saxifraga", "Mniaceae OR Moss", "Mniaceae OR Splachnaceae OR Bartramiaceae OR Ditrichaceae OR Meesiaceae OR Rhizogoniaceae OR Moss",
"Moneses uniflora"), comb_S026401.R1 = c(4713, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 792, 0, 0,
0, 0, 0, 0, 0, 0, 0, 16, 31, 0, 0, 0, 133, 0, 1649, 0, 0, 0,
0, 0, 0, 29, 14, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 150, 0,
19, 8, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4517,
0, 0, 0, 0, 0, 0, 0, 0, 2453, 0, 0, 0, 0, 0, 35, 0, 0, 0), comb_S026404.R1 = c(485,
0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 15, 0, 196, 342,
75, 0, 0, 0, 0, 0, 0, 251, 0, 0, 0, 0, 0, 9, 35, 0, 0, 0, 0,
0, 0, 0, 0, 0, 56, 57, 0, 0, 0, 787, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0), comb_S026406.R1 = c(5626, 0, 0, 0, 127, 14, 0, 0, 0, 0,
0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 472, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 227, 0, 18, 0, 25, 160, 540, 0, 0, 0, 0, 0, 8, 87,
0, 0, 0, 0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 34, 0, 16, 13, 11, 0,
0, 0, 2208, 0, 0, 0, 28, 0, 0, 0, 0, 0, 10, 0, 722, 0, 0, 0,
0, 0, 0, 28, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026409.R1 = c(2020,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 1324, 0, 8,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0,
22, 0, 1302, 0, 0, 0, 0, 0, 4197, 0, 0, 0, 0, 0, 0, 8, 0, 0,
0, 0, 384, 0, 0, 0, 0, 69, 0, 0, 0, 442, 0, 0, 0, 0, 0, 228,
0, 0, 0), comb_S026412.R1 = c(331, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 31, 0, 0, 0, 0, 28, 8, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0,
0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 25, 0, 14, 0, 0, 0, 0, 0, 322,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 6959, 0, 0, 0, 0, 0, 0,
0, 17, 0, 0, 0, 0, 0, 10, 0, 0, 0), comb_S026413.R1 = c(1394,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 30, 0, 0, 0, 0, 0,
0, 0, 21, 0, 0, 0, 0, 28, 0, 0, 0, 0, 26, 156, 0, 0, 0, 162,
29, 41, 0, 0, 0, 0, 0, 351, 129, 0, 0, 0, 0, 0, 0, 125, 0, 0,
0, 0, 0, 0, 44, 0, 377, 0, 0, 0, 0, 0, 1043, 0, 38, 0, 17, 0,
0, 0, 0, 0, 0, 0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0,
0, 660, 0, 0, 0), comb_S026414.R1 = c(21, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 22, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 978, 292, 52, 0, 0, 0, 0, 0, 0,
619, 0, 0, 0, 0, 0, 0, 256, 0, 22, 0, 0, 0, 0, 194, 0, 1075,
0, 0, 0, 0, 0, 5098, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1360,
0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 826, 12, 0, 0, 0), comb_S026415.R1 = c(0,
10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 28, 0, 0,
0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026416.R1 = c(271,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,
0, 0, 273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 36, 0, 0, 0, 154, 5043,
314, 0, 0, 0, 0, 0, 11, 15, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0,
0, 0, 240, 0, 228, 0, 0, 0, 0, 0, 140, 31, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 714, 0, 0, 0, 0, 26, 0, 0, 0, 222, 0, 0, 0, 0, 56,
191, 0, 0, 0), comb_S026419.R1 = c(0, 0, 0, 0, 0, 0, 0, 0, 17,
0, 0, 0, 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 676, 0, 0, 0, 0,
0, 0, 0, 0, 0, 135, 0, 0, 0, 0, 129, 142, 126, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 6521, 0,
0, 0, 0, 0, 4088, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 20, 0,
0, 0, 0, 0, 0, 0, 116, 0, 0, 0, 0, 305, 361, 0, 0, 0), comb_S026421.R1 = c(4689,
47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 23, 0, 0, 0, 0, 0,
0, 0, 208, 0, 0, 0, 34, 0, 0, 111, 0, 29, 0, 38, 0, 0, 0, 113,
37, 272, 0, 0, 0, 0, 0, 0, 286, 22, 0, 57, 0, 0, 13, 663, 0,
0, 0, 154, 0, 29, 376, 0, 130, 0, 0, 0, 0, 0, 442, 0, 49, 0,
191, 14, 0, 24, 0, 0, 0, 0, 2075, 187, 0, 0, 0, 102, 0, 0, 90,
3498, 0, 0, 67, 0, 0, 16, 0, 0, 0), comb_S026422.R1 = c(95, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, 0, 0, 340, 85,
0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 178, 0, 137, 0, 0, 0,
0, 9, 0, 1174, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, 0, 28, 0, 0,
0, 0, 588, 2692, 0, 0, 0, 33, 0, 0, 0, 12, 0, 0, 0, 0, 198, 26,
0, 0, 0), comb_S026423.R1 = c(360, 0, 0, 0, 0, 0, 0, 0, 14, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 614, 0, 0, 0, 0, 0, 0,
0, 0, 9, 279, 0, 0, 0, 0, 32, 251, 94, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 212, 0, 10, 0, 0, 0, 0, 0, 0, 781, 0, 0, 0, 0,
0, 1608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1200, 0, 0, 0, 0, 76,
0, 0, 0, 2382, 0, 0, 0, 0, 149, 259, 0, 0, 0), comb_S026427.R1 = c(666,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0,
0, 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1545, 37, 475,
0, 0, 0, 0, 0, 0, 111, 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, 0,
0, 146, 0, 116, 0, 0, 0, 0, 0, 117, 0, 0, 0, 34, 0, 0, 0, 0,
0, 0, 0, 1062, 71, 0, 0, 0, 51, 0, 0, 0, 722, 0, 0, 0, 0, 0,
0, 0, 0, 0), comb_S026428.R1 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 0, 857, 1071,
0, 0, 1435, 0, 0, 0, 63, 0, 0, 387, 0, 0, 301, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 625, 0, 0,
0, 0, 819, 672, 0, 0, 0, 0, 0, 0, 4313, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026429.R1 = c(21,
0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 340, 0, 0, 10, 22, 190,
0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 252, 0, 165, 0, 0,
0, 0, 35, 0, 124, 0, 0, 0, 0, 0, 138, 0, 0, 0, 145, 0, 0, 0,
0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 12,
0, 0, 0), comb_S026431.R1 = c(1545, 9, 0, 0, 0, 0, 0, 0, 10,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, 0, 0, 0,
0, 0, 0, 8, 61, 18, 0, 0, 0, 67, 12, 69, 0, 0, 0, 0, 0, 0, 11,
10, 0, 0, 10, 0, 0, 21, 0, 0, 0, 0, 0, 0, 10, 0, 2395, 0, 0,
0, 0, 0, 974, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 7078, 0, 0, 0,
0, 11, 0, 0, 0, 35, 0, 0, 0, 0, 596, 269, 0, 0, 0), comb_S026430.R1 = c(322,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 507, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 33, 0, 0, 0, 562, 6336,
336, 0, 0, 0, 0, 0, 17, 32, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0,
0, 0, 228, 0, 340, 0, 0, 0, 0, 0, 257, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 687, 11, 0, 0, 0, 65, 0, 0, 0, 167, 0, 0, 0, 0, 0, 141,
0, 0, 0), comb_S026432.R1 = c(2878, 0, 0, 0, 0, 0, 0, 0, 8, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 19, 0, 0, 36, 0, 0, 0, 0, 0, 0,
0, 0, 0, 270, 45, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 36, 77, 0,
0, 0, 0, 0, 0, 360, 0, 0, 9, 0, 0, 0, 191, 0, 488, 8, 8, 0, 0,
0, 1428, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 852, 0, 0, 0, 0, 0,
0, 0, 0, 22, 11, 0, 0, 0, 0, 152, 0, 0, 0), comb_S026433.R1 = c(908,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 0, 0, 0, 0, 15, 0,
0, 0, 293, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 67, 0, 0, 0, 2045, 25,
21, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0, 300, 0, 28, 0, 0,
0, 0, 251, 0, 564, 0, 0, 0, 0, 0, 4901, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 869, 0, 0, 0, 0, 103, 0, 0, 0, 224, 0, 0, 0, 0, 0,
0, 0, 0, 0), comb_S026434.R1 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 13,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 172, 0, 12, 0, 166, 1591, 50, 0, 0, 0, 0, 0, 0, 11,
44, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 140, 0, 34, 0, 0, 0,
0, 0, 365, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 41, 1234, 0, 0, 0,
0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 548, 138, 0, 0, 0), comb_S026435.R1 = c(1961,
83, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
0, 0, 332, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 15, 0, 11, 0, 233, 890,
69, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0,
0, 0, 31, 0, 3144, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 15,
0, 0, 0, 0, 1881, 0, 0, 0, 0, 9, 0, 0, 0, 163, 0, 0, 0, 0, 224,
70, 0, 0, 0), comb_S026438.R1 = c(1944, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 9, 30, 0, 0, 79, 0, 0, 0, 0,
0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 41,
0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 197, 814, 18, 253, 0, 0,
0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 60, 0, 0, 0,
0, 0, 0, 0, 0, 623, 0, 0, 0, 0, 474, 556, 0, 0, 0), comb_S026440.R1 = c(1955,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, 438, 1653,
65, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0,
0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 1954, 0, 16, 0, 0, 0, 0, 0, 0,
0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 30,
0, 0, 0), comb_S026444.R1 = c(3372, 0, 0, 11, 0, 0, 0, 0, 100,
0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 18, 0, 0, 0, 14, 0, 0, 0, 0, 0,
0, 0, 0, 0, 9, 251, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 38, 19,
26, 0, 0, 0, 0, 0, 1106, 0, 0, 0, 0, 0, 22, 94, 0, 1428, 0, 0,
0, 0, 0, 2669, 0, 31, 15, 0, 0, 0, 0, 0, 0, 0, 0, 526, 0, 0,
0, 0, 86, 0, 0, 0, 58, 0, 0, 0, 0, 0, 541, 0, 0, 0), comb_S026447.R1 = c(0,
0, 0, 0, 34, 17, 0, 0, 15, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1168, 0, 0, 0, 15, 0, 0, 0, 0, 13, 41, 26, 0, 0, 0,
187, 41, 74, 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 10, 0, 1242, 0, 0, 0, 0, 0, 9354, 0, 39, 0, 0, 0,
0, 0, 0, 0, 0, 0, 464, 0, 0, 0, 0, 36, 0, 0, 0, 91, 0, 0, 0,
0, 112, 79, 91, 0, 0), comb_S026450.R1 = c(0, 564, 0, 0, 10,
0, 0, 0, 0, 8, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 342, 226, 0, 0, 40, 0,
0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 10, 0, 2260,
0, 0, 0, 0, 0, 967, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026451.R1 = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 741, 0, 0, 0, 1227, 224,
0, 0, 0, 0, 0, 348, 0, 2118, 0, 0, 0, 0, 0, 0, 2751, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2280, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 382, 0, 0, 1468, 0, 0, 0, 0, 0, 0,
0, 0, 0), comb_S026453.R1 = c(2721, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 31, 53, 0, 0, 0, 0, 0, 0, 149, 0, 0, 0, 0, 0,
0, 0, 8, 0, 0, 739, 0, 13, 0, 193, 67, 0, 0, 0, 0, 0, 0, 0, 104,
0, 0, 0, 0, 0, 0, 153, 0, 0, 0, 0, 0, 0, 77, 0, 2338, 0, 10,
0, 0, 0, 1608, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 2144, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026456.R1 = c(10365,
0, 0, 0, 147, 21, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0,
0, 0, 0, 585, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 710, 0, 70, 0, 66,
365, 505, 0, 0, 0, 0, 0, 0, 176, 0, 0, 0, 0, 0, 0, 184, 0, 95,
0, 0, 0, 0, 32, 0, 51, 25, 37, 0, 0, 0, 732, 0, 21, 0, 30, 0,
0, 0, 9, 0, 0, 0, 1082, 9, 0, 0, 0, 0, 0, 43, 0, 62, 0, 13, 0,
0, 0, 0, 0, 0, 0), comb_S026457.R1 = c(89, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 456, 10, 0,
0, 0, 0, 0, 0, 0, 35, 253, 0, 0, 0, 0, 31, 8, 548, 0, 0, 0, 0,
0, 0, 27, 27, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, 0, 0, 0, 319,
0, 0, 0, 0, 0, 6466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1262, 0,
0, 0, 0, 50, 0, 0, 0, 630, 0, 0, 0, 0, 50, 12, 0, 0, 0), comb_S026458.R1 = c(36,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 21, 13,
0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 0, 0, 0, 1678, 51,
36, 0, 0, 0, 0, 0, 0, 97, 13, 0, 0, 0, 0, 0, 543, 0, 0, 0, 0,
0, 0, 66, 0, 505, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1193, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 811, 0,
0, 0, 0), comb_S026461.R1 = c(650, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 9, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 8, 0, 0, 28, 0, 0, 0,
0, 0, 9, 40, 829, 0, 0, 0, 834, 34, 16, 0, 0, 0, 0, 0, 0, 490,
0, 0, 0, 0, 0, 0, 100, 0, 75, 0, 0, 0, 19, 0, 0, 100, 0, 0, 0,
0, 0, 1077, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 199, 16847, 0, 0,
0, 55, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026462.R1 = c(3645,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 12,
0, 9, 786, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 3978, 0, 0, 0, 580,
0, 1341, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0, 0, 0, 0, 283, 0, 0,
0, 0, 0, 0, 80, 0, 561, 36, 17, 0, 0, 0, 1111, 0, 0, 0, 77, 0,
0, 0, 0, 0, 0, 0, 1805, 14, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0,
0, 16, 20, 0, 0, 0), comb_S026463.R1 = c(22, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 1115, 59, 0, 0, 0, 0, 0,
0, 0, 12, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0,
0, 0, 0, 0, 468, 153, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 130, 0, 0, 0, 0, 1267, 0, 0, 0, 0), comb_S026464.R1 = c(0,
764, 0, 0, 0, 0, 0, 0, 338, 0, 0, 96, 0, 0, 0, 0, 0, 307, 2313,
0, 0, 0, 0, 91, 0, 0, 44, 0, 0, 0, 127, 463, 12, 37, 0, 13, 186,
0, 35, 21, 41, 0, 0, 136, 0, 0, 0, 1019, 0, 29, 0, 0, 0, 102,
0, 0, 0, 0, 0, 22, 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 45, 0, 0, 0, 0, 0, 602, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0), comb_S026467.R1 = c(0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 484, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 2348, 0,
0, 0, 0, 0, 0, 0, 243, 11, 0, 9, 0, 0, 92, 82, 0, 669, 0, 0,
0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 195, 0, 0, 0, 0, 0, 0, 9,
0, 1479, 0, 0, 0, 0, 0, 2210, 32, 27, 0, 0, 0, 0, 0, 0, 0, 0,
0, 974, 0, 0, 23, 0, 0, 0, 0, 0, 12, 0, 0, 0, 9, 0, 0, 0, 0,
0), comb_S026466.R1 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2171, 0, 0, 0, 14, 220, 15, 0, 0, 0, 0, 0, 0, 5733, 0, 0,
0, 0, 0, 0, 309, 0, 0, 0, 0, 0, 0, 0, 0, 524, 0, 0, 0, 18, 0,
897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026469.R1 = c(797, 0,
0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29, 0, 0, 0, 0, 0, 0, 0, 0, 8, 87, 16, 0, 0, 0, 301, 0, 15, 0,
0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 28,
0, 649, 0, 0, 0, 0, 0, 602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
251, 0, 0, 0, 0, 132, 0, 0, 0, 225, 0, 0, 0, 0, 0, 684, 0, 0,
0), comb_S026470.R1 = c(30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1402, 0, 35, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0,
0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 40, 10, 16, 0, 0, 70, 0, 0, 3301,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8085, 0, 0, 0, 0, 0, 0, 0, 0,
22, 0, 0, 0, 0, 0, 0, 0, 0, 0), comb_S026471.R1 = c(6519, 0,
0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 12, 0, 0,
0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 503, 0, 228, 0, 85, 200,
156, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 111, 0, 0, 0, 0,
0, 0, 0, 0, 0, 17, 10, 0, 0, 0, 522, 0, 42, 0, 51, 0, 0, 0, 0,
0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 311, 0, 0, 0, 0, 8, 0, 0,
0, 0), comb_S026473.R1 = c(26, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0,
0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, 0, 0, 0, 0,
31, 57, 633, 9, 0, 0, 0, 577, 68, 119, 0, 0, 0, 0, 0, 0, 31,
0, 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, 0, 15, 15, 0, 868, 0, 0, 0,
0, 0, 3912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 447, 0, 0, 0, 0,
0, 0, 0, 0, 140, 0, 0, 0, 0, 778, 1379, 0, 0, 0), comb_S026474.R1 = c(0,
2046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 54, 0, 0, 0, 0, 0, 672,
0, 0, 0, 0, 338, 0, 0, 14, 0, 0, 0, 0, 159, 168, 0, 0, 0, 55,
218, 0, 0, 12, 0, 0, 0, 98, 0, 0, 262, 0, 0, 0, 0, 0, 0, 0, 0,
0, 53, 0, 0, 0, 0, 0, 319, 0, 0, 0, 0, 0, 179, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 71), comb_S026476.R1 = c(1181, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 10, 0, 0, 1077, 0, 0, 0,
0, 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, 66, 529, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 43, 0, 0, 519, 0, 0, 0, 40, 0, 0, 47, 0, 193,
0, 0, 0, 0, 0, 1435, 0, 0, 0, 0, 0, 0, 99, 0, 47, 0, 29, 167,
32, 58, 0, 0, 0, 0, 0, 0, 1029, 0, 0, 0, 0, 410, 0, 0, 0, 0),
comb_S026477.R1 = c(53, 0, 10, 0, 0, 0, 0, 0, 43, 0, 0, 0,
21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 892, 0, 0, 11, 0, 0, 0,
33, 0, 13, 0, 9, 0, 151, 0, 25, 89, 66, 15, 0, 0, 0, 0, 79,
22, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 0,
0, 0, 0, 0, 177, 780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 963, 36, 0, 0, 0),
comb_S026483.R1 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 22, 21, 49, 12, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 134, 0, 0, 0, 68, 1175, 18, 0, 0, 0, 0, 0, 0, 0, 94,
0, 0, 0, 0, 20, 0, 689, 0, 12, 0, 0, 0, 0, 97, 0, 288, 0,
0, 0, 0, 0, 280, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0,
0, 0, 0, 0, 0, 0, 0, 204, 0, 0, 0, 0, 28, 76, 0, 0, 0), comb_S026484.R1 = c(170,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0,
153, 166, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52,
0, 0, 0, 0, 0, 0, 21, 0, 750, 0, 0, 0, 0, 0, 8851, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 952, 0, 0, 0, 0, 0, 0, 0, 0, 1330,
0, 0, 0, 0, 33, 1330, 0, 0, 0), comb_S026485.R1 = c(37, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
0, 0, 78, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 1570,
57, 69, 14, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, 0,
0, 0, 0, 0, 0, 59, 0, 394, 0, 0, 0, 0, 0, 6387, 0, 0, 0,
0, 0, 0, 13, 0, 0, 0, 0, 2119, 31, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 962, 0, 0, 0, 0), comb_S026488.R1 = c(73, 0,
0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 215,
867, 168, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 33, 0,
0, 0, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0,
10, 0, 25, 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, 0, 0, 0, 282,
0, 0, 0, 0, 4219, 0, 0, 0, 0), comb_S026489.R1 = c(25, 17,
0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 140, 0, 0, 0, 0, 0, 0, 0, 0, 49, 463, 83, 0, 0, 0,
331, 74, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206,
0, 0, 0, 0, 0, 0, 97, 0, 2031, 0, 0, 0, 0, 0, 227, 0, 0,
16, 0, 0, 0, 0, 0, 0, 0, 0, 396, 0, 0, 0, 0, 0, 0, 0, 0,
616, 0, 0, 0, 0, 4429, 2526, 0, 0, 0), comb_S026490.R1 = c(19,
0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0,
24, 552, 333, 0, 0, 0, 0, 0, 0, 291, 0, 0, 0, 0, 0, 0, 18,
0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 3654, 60, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 433, 0, 0, 0, 0, 0, 0, 0, 0, 907,
0, 0, 0, 0, 1561, 0, 0, 38, 0), comb_S026493.R1 = c(3353,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 0, 0, 0,
0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 13, 0, 0, 22, 129, 0, 0,
0, 87, 216, 145, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0,
221, 0, 0, 0, 0, 0, 8, 133, 0, 344, 0, 0, 0, 0, 0, 59, 0,
0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 4523, 0, 8, 0, 0, 49, 0, 0,
0, 150, 0, 0, 0, 0, 0, 38, 0, 0, 0)), row.names = c(NA, 100L
), class = "data.frame")
second dataframe, containing functional classes(subset of first 200 rows):
structure(list(CODE = c("AGOSSP", "ALYALY", "ARABSP", "ARESER",
"BUPAME", "CALLSP", "CENSTO", "CERNUT", "CIRSCA", "CLAPER", "CLAPUL",
"CLARUB", "COLGRA", "COLLIN", "COLPAR", "CYNOFF", "DESCSP", "DESSOP",
"DRABSP", "DRAREP", "EPIBRA", "GALAPA", "GALBIF", "GAYHUM", "GENAMA",
"GERBIC", "GERVIS", "HOLUMB", "LACSER", "LAMAMB", "LAPRED", "LAPSQU",
"LOGARV", "MADEXI", "MADISP", "MEDLUP", "MELLIN", "MELOFF", "MICGRA",
"MINRUB", "MONPAR", "MYOSTR", "OROUNI", "ORTTEN", "PHAFRA", "PHALIN",
"POLDOU", "POLMIN", "PULDOU", "THLARV", "TRADUB", "TRIAUR", "VERARV",
"VERTHA", "VERVER", "AVEFAT", "BROARV", "BROBRI", "BROJAP", "BROTEC"
), NameScientific = c("Agoseris sp", "Alyssum alyssoides", "Arabis sp",
"Arenaria serpyllifolia", "Bupleurum americanum", "Callitriche sp",
"Centaurea stoebe", "Cerastium nutans", "Cirsium scariosum",
"Claytonia perfoliata", "Clarkia pulchella", "Claytonia rubra",
"Collomia grandiflora", "Collomia linearis", "Collinsia parviflora",
"Cynoglossum officinale", "Descurainia sp", "Descurainia sophia",
"Draba sp", "Draba reptans", "Epilobium brachycarpum", "Galium aparine",
"Galium bifolium", "Gayophytum humile", "Gentianella amarella",
"Geranium bicknellii", "Geranium viscosissimum", "Holosteum umbellatum",
"Lactuca serriola", "Lamium amplexicaule", "Lappula redowskii",
"Lappula squarrosa", "Logfia arvensis", "Madia exigua", "Madia sp",
"Medicago lupulina", "Melampyrum lineare", "Melilotus officinalis",
"Microsteris gracilis", "Minuartia rubella", "Montia parvifolia",
"Myosotis stricta", "Orobanche uniflora", "Orthocarpus tenuifolius",
"Phacelia franklinii", "Phacelia linearis", "Polygonum douglasii",
"Polygonum minimum", "Polygonum douglasii", "Thlaspi arvense",
"Tragopogon dubius", "Trifolium aureum", "Veronica arvensis",
"Verbascum thapsus", "Veronica verna", "Avena fatua", "Bromus arvensis",
"Bromus briziformis", "Bromus japonicus", "Bromus tectorum"),
Genus = c("Agoseris", "Alyssum", "Arabis", "ARENARIA", "Bupleurum",
"Callitiriche", "Centaurea", "Cerastium", "Cirsium", "Claytonia",
"Clarkia", "Claytonia", "Collomia", "Collomia", "Collinsia",
"Cynoglossum", "Descurainia", "Descurainia", "Draba", "DRABA",
"Epilobium", "Galium", "Galium", "Gayophytum", "GENTIANELLA",
"GERANIUM", "Geranium", "Holosteum", "Lactuca", "Lamium",
"Lappula", "Lappula", "Logfia", "Madia", "MADIA", "Medicago",
"Melampyrum", "Melilotus", "Microsteris", "MINUARTIA", NA,
"Myosotis", "Orobanche", "ORTHOCARPUS", "Phacelia", "Phacelia",
"Polygonum", "POLYGONUM", "Polygonum", "Thlaspi", "Tragopogon",
"Trifolium", "Veronica", "Verbascum", "Veronica", "Avena",
"BROMUS", "Bromus", "Bromus", "Bromus"), Species = c("sp",
"alyssoides", "sp", "SERPYLLIFOLIA", "americanum", "sp",
"stoebe", "nutans", "scariosum", "perfoliata", "pulchella",
"rubra", "grandiflora", "linearis", "parviflora", "officinale",
"sp", "sophia", "sp", "REPTANS", "brachycarpum", "aparine",
"bifolium", "humile", "AMARELLA", "BICKNELLII", "viscosissimum",
"umbellatum", "serriola", "amplexicaule", "redowskii", "squarrosa",
"arvensis", "exigua", "SP", "lupulina", "lineare", "officinalis",
"gracilis", "RUBELLA", NA, "stricta", "uniflora", "TENUIFOLIUS",
"franklinii", "linearis", "douglasii", "MINIMUM", "douglasii",
"arvense", "dubius", "aureum", "arvensis", "thapsus", "verna",
"fatua", "ARVENSIS", "briziformis", "japonicus", "tectorum"
), Family = c("Asteraceae", "Brassicaceae", "Brassicaceae",
"Caryophyllaceae", "Apiaceae", "Callitrichaceae", "Asteraceae",
"Caryophyllaceae", "Asteraceae", "Montiaceae", "Onagraceae",
"Montiaceae", "Polemoniaceae", "Polemoniaceae", "Plantaginaceae",
"Boraginaceae", "Brassicaceae", "Brassicaceae", "Brassicaceae",
"Brassicaceae", "Onagraceae", "Rubiaceae", "Rubiaceae", "Onagraceae",
"Gentianaceae", "Gerianaceae", "Geraniaceae", "Caryophyllaceae",
"Asteraceae", "Lamiaceae", "Boraginaceae", "Boraginaceae",
"Asteraceae", "Asteraceae", "Asteraceae", "Fabaceae", "Orobanchaceae",
"Fabaceae", "Polemoniaceae", "Caryophyllaceae", NA, "Boraginaceae",
"Orobanchaceae", "Scrophulariaceae", "Hydrophyllaceae", "Hydrophyllaceae",
"Polygonaceae", "Polygonaceae", "Polygonaceae", "Brassicaceae",
"Asteraceae", "Fabaceae", "Plantaginaceae", "Scrophulariaceae",
"Plantaginaceae", "Poaceae", "Poaceae", "Poaceae", "Poaceae",
"Poaceae"), Form = c("Forb", "Forb", "Forb", "Forb", "Forb",
"Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb",
"Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb",
"Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb",
"Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb",
"Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb",
"Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb", "Forb",
"Forb", "Forb", "Graminoid", "Graminoid", "Graminoid", "Graminoid",
"Graminoid"), LifeHistory = c("Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual", "Annual", "Annual", "Annual",
"Annual", "Annual", "Annual"), Origin = c("Native", "Exotic",
"Native", "Exotic", "Native", "UNK", "Exotic", "Native",
"Native", "Native", "Native", "Native", "Native", "Native",
"Native", "Exotic", "UNK", "Exotic", "Native", "Native",
"Native", "Native", "Native", "Native", "Native", "Native",
"Native", "Exotic", "Exotic", "Exotic", "Native", "Exotic",
"Exotic", "Native", "Native", "Exotic", "Native", "Exotic",
"Native", "Native", "Native", "Exotic", "Native", "Native",
"Native", "Native", "Native", "Native", "Native", "Exotic",
"Exotic", "Exotic", "Exotic", "Exotic", "Exotic", "Exotic",
"Exotic", "Exotic", "Exotic", "Exotic"), C_Value = c(NA,
"0", NA, "0", "5", NA, "0", "4", "5", "3", "4", "4", NA,
"4", "3", "0", NA, "0", NA, NA, "4", "3", NA, NA, "4", "3",
"4", "0", "0", "1", NA, "1", "0", NA, NA, "0", "6", "0",
"3", "5", "5", "0", "4", "4", NA, "3", "4", "5", "4", "0",
"0", "0", "0", "0", "1", "1", "1", "1", "0", "0"), X = c("",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "")), row.names = c(NA,
60L), class = "data.frame")
I'm very new to r- i've been trying to figure out if some part of fuzzyjoin could work, also using ore simple %in% to try and merge... but generally pretty lost
The following code merges the two data.frames by SPP and Genus after splitting SPP by the separator "OR" and creating a temporary data set with one row per unique value of SPP.
It uses packages dplyr and tidyr.
library(dplyr)
spp <- strsplit(df1$SPP, "OR")
spp <- lapply(spp, trimws)
spp_len <- sapply(spp, length)
new_row <- rep(NA_character_, max(spp_len))
names(new_row) <- sprintf("SPP_%d", seq_len(max(spp_len)))
result <- t(mapply(\(x, n) {
if(length(x)) new_row[1:n] <- x
new_row
}, spp, spp_len)) %>%
as.data.frame()
rm(new_row)
result <- result %>%
bind_cols(df1[-1]) %>%
tidyr::pivot_longer(starts_with("SPP"), values_to = "SPP") |>
select(-name) %>%
relocate(SPP) %>%
tidyr::drop_na() %>%
left_join(df2, by = c("SPP" = "Genus"))
str(result)

RC Bray function not accepting phyloseq otu_table as argument

I am using James Stegen et al's code here to calculate an abundance-weighted raup-crick value for my 16S dataset.
I load in my phyloseq object then extract the otu_table. I then use the otu_table as the spXsite argument in the function raup_crick_abundance(). My otu_table is available as a dput() below the text.
physeq<-qza_to_phyloseq(
features="~/Documents/qiime2-analyses/CRD/fresh_run/table.qza",
tree="~/Documents/qiime2-analyses/CRD/fresh_run/rooted-tree.qza",
"~/Documents/qiime2-analyses/CRD/fresh_run/taxonomy.qza",
metadata = "crd-metadata.txt")
otu_table <- (otu_table(physeq))
raup_crick_abundance = function(spXsite=otu_table, plot_names_in_col1=TRUE,
reps=9999, set_all_species_equal=FALSE,
as.distance.matrix=TRUE, report_similarity=FALSE){
Where the remaining code is verbatim from the github link above.
I am having a hard time understanding the error I have been receiving:
Error in sample.int(x, size, replace, prob) :
incorrect number of probabilities
Called from: sample.int(x, size, replace, prob)
Browse[1]> traceback()
1: raup_crick_abundance()
I had thought perhaps the function was looking for an equivalent number of columns and rows, but that was not the case. I searched the function sample() and think it's hoping to select values from my argument otu_table but can't find the expected range?
The sample() causing problems is on line 48 of the github where I believe the function is weighing the otu occurrences and entering the number of occurrences into a column.
##two empty null communities of size gamma:
com1<-rep(0,gamma)
com2<-rep(0,gamma)
##add observed number of species to com1, weighting by species occurrence frequencies:
com1[sample(1:gamma, sum(spXsite.inc[null.one,]), replace=FALSE, prob=occur)]<-1
com1.samp.sp = sample(which(com1>0),(sum(spXsite[null.one,])-sum(com1)),replace=TRUE,prob=abundance[which(com1>0)]);
com1.samp.sp = cbind(com1.samp.sp,1); # head(com1.samp.sp);
com1.sp.counts = as.data.frame(tapply(com1.samp.sp[,2],com1.samp.sp[,1],FUN=sum)); colnames(com1.sp.counts) = 'counts'; # head(com1.sp.counts);
com1.sp.counts$sp = as.numeric(rownames(com1.sp.counts)); # head(com1.sp.counts);
com1[com1.sp.counts$sp] = com1[com1.sp.counts$sp] + com1.sp.counts$counts; # com1;
#sum(com1) - sum(spXsite[null.one,]); ## this should be zero if everything work properly
rm('com1.samp.sp','com1.sp.counts');
Any thoughts are greatly appreciated. Thank you in advance!
> dput(otu_table)
new("otu_table", .Data = structure(c(0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 4), .Dim = c(6L, 48L), .Dimnames = list(
c("e54924083c02bd088c69537d02406eb8", "3112899fc7a2adb7f74a081a82c7cde4",
"db5d745b02355b6fed513c4953b62326", "2faf2046aa9ab2f6598df79cd52e9c7b",
"bec8db81cc8ec453136c82ede8327a9f", "601e47b8adcbd21d159f74421710e1b5"
), c("sample-10", "sample-11", "sample-12", "sample-14",
"sample-16", "sample-18", "sample-19", "sample-20", "sample-21",
"sample-22", "sample-23", "sample-24", "sample-25", "sample-26",
"sample-27", "sample-28", "sample-29", "sample-30", "sample-31",
"sample-32", "sample-33", "sample-34", "sample-35", "sample-36",
"sample-37", "sample-40", "sample-41", "sample-43", "sample-44",
"sample-45", "sample-46", "sample-50", "sample-55", "sample-56",
"sample-57", "sample-58", "sample-59", "sample-61", "sample-62",
"sample-63", "sample-64", "sample-65", "sample-67", "sample-68",
"sample-69", "sample-70", "sample-71", "sample-8"))), taxa_are_rows = TRUE)
>

Errors with distance-decay using betapart and ddecay packages

My goal is to create a distance-decay curve for species data vs geographic distance. However, I am running into errors. For the betapart package, this may be due to the lack of columns relative to the number of rows. Is there a way to get past this? If not, is there another method for creating a distance-decay curve (and plotting it)? I also tried the ddecay package but ran into errors there too. Any help is much appreciated. Data is in structure form below.
# BETAPART -------------------------------------------------
library(betapart)
spat.dist<-dist(coords)
dissim.BCI<-beta.pair.abund(spec)$beta.bray.bal
plot(spat.dist, dissim.BCI, ylim=c(0,1), xlim=c(0, max(spat.dist)))
BCI.decay.exp<-decay.model(dissim.BCI, spat.dist, y.type="dissim", model.type="exp", perm=100)
#========================================================================================================
I also tried a few other packages --------------------------
# ddecay package -------------------------------------------
devtools::install_github("chihlinwei/ddecay")
the issue with this method is that it requires the use of a gradient however, I would like to avoid that if possible but I do not see a way around this. Also they do not include their example data in the package.
dd <- beta.decay(gradient=spat.dist, counts=decostand(spec, method="pa"),
coords=coords, nboots=1000,
dis.fun = "beta.pair", index.family = "sorensen", dis = 1, like.pairs=T)
x <- vegdist(coords, method = "euclidean")
y <- 1 - dist(decostand(spec, method="pa"), index.family = "sorensen")[[1]]
plot(x, y)
lines(dd$Predictions[, "x"], dd$Predictions[,"mean"], col="red", lwd=2)
#========================================================================================================
# DATA -----------------------------------------------------
spec <- structure(list(Ccol = c(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), Acol = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0), NYcol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0), Mcol = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0), AAcol = c(14, 0, 14, 3, 11, 1, 0, 2, 0,
3, 0, 4, 0, 1, 8, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 7),
Ncol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1), ATBcol = c(0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 3), CVcol = c(0, 0, 0, 0, 0, 0, 1, 20,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 2, 0, 0,
0, 6), AZNcol = c(0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), GBcol = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0), KHAcol = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0), AFcol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0), AFPcol = c(0,
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1), TIAcol = c(4, 1, 0, 2, 6, 0,
1, 1, 0, 2, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0), AUcol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), AScol = c(0,
4, 0, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 5, 0, 0), NSAcol = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 7, 0, 0, 3, 0, 0, 0, 4, 0, 2, 0, 1, 0, 9, 5, 1,
0, 0, 2, 0), WZcol = c(0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 4,
0, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 17, 4, 0, 0, 0, 0, 0), AJcol = c(0,
3, 6, 0, 0, 1, 0, 4, 0, 0, 0, 0, 39, 12, 0, 0, 0, 0, 0, 0,
0, 4, 5, 1, 12, 13, 16, 0, 5), EADcol = c(4, 1, 2, 1, 2,
0, 0, 0, 0, 4, 0, 2, 1, 1, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0,
0, 0, 0, 0, 1), CAcol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), Pcol = c(0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 60, 0, 0,
13, 0, 8, 1, 0, 0, 0, 0, 0), ASDcol = c(3, 5, 6, 17, 3, 5,
26, 2, 0, 17, 3, 10, 6, 3, 2, 4, 0, 0, 5, 25, 0, 0, 0, 2,
2, 9, 0, 2, 8), RMAcol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
OUcol = c(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), KAcol = c(0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
0, 0, 0, 0, 0, 8, 1), PACcol = c(0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 2, 0, 37, 0, 24,
1, 0, 0), LAAcol = c(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), GAcol = c(1,
0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0,
0, 0, 3, 0, 0, 0, 2, 0, 0), AAcol = c(1, 0, 1, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0), EVAcol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0), EAcol = c(0,
0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0), AKcol = c(0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0), Acol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 1, 0), QAcol = c(0,
0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0), YAcol = c(11, 24, 21, 63, 44,
95, 12, 43, 0, 5, 26, 22, 25, 48, 86, 2, 0, 0, 13, 0, 0,
2, 0, 0, 60, 6, 7, 0, 45), BANcol = c(0, 0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 0, 24, 0, 6, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
9, 17, 17), VCcol = c(0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), Vcol = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0), Ocol = c(0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0), AVcol = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), JXcol = c(0,
3, 3, 0, 0, 0, 0, 0, 8, 0, 0, 10, 3, 0, 0, 5, 0, 0, 0, 1,
0, 0, 0, 2, 4, 1, 0, 0, 0)), class = "data.frame", row.names = c(NA,
-29L))
coords <- structure(list(Lat.x = c(34.43363, 34.36784, 34.32587, 34.19891,
34.24217, 34.24863, 34.18137, 34.16838, 34.10961, 34.08329, 34.40571,
34.39591, 34.39292, 34.37466, 34.28948, 34.26146, 34.04687, 34.0409,
34.068339, 34.34679, 34.17161, 34.23308, 34.21544, 34.14922,
34.27539, 34.2323, 34.19057, 34.07042, 34.06289), Lon.x = c(-94.94494,
-94.92512, -94.94429, -94.84497, -94.8573, -94.85641, -94.887,
-94.91322, -94.92913, -94.93276, -95.02622, -95.04382, -94.96295,
-94.83733, -94.81071, -94.79161, -95.03968, -95.0608, -95.086986,
-95.03345, -95.23862, -95.25619, -95.1041, -95.02286, -95.02672,
-95.02626, -95.02941, -95.01746, -94.98786)), class = "data.frame", row.names = c(NA,
-29L))
You can get more answers, if you tell what was the problem. For instance, which functions failed and what was the error message. I had a look at betapart::decay.model(), where I could get this error message:
Error in eval(family$initialize) :
cannot find valid starting values: please specify some
I cut the long story short: you cannot use this function with your data because you have dissimilarities of 1 in your data, dissimilarities are turned into similarities with 1-dissimilarity and this makes these values zero similarities (that is, these pairs of sampling unit have nothing in common, they share no species). Function decay.model uses glm with gaussian family with log-link, and log-link requires that you give the starting values, if you have zeros in the y-variate.
I think that you have four alternatives:
You do not use the method as it does not suit your data.
You modify the decay.model function so that you can specify the starting values, like the error message suggested. This means that you add mustart to the function call so that it reads, e.g., glm(y ~ x, family=gaussian(link="log"), mustart=pmax(y, 0.01)). This replaces zeros with 0.01 as starting values.
You change maximum distances from 1 to something smaller, for instance, 0.99: dissim.BCI[dissim.BCI==1] <- 0.99. However, this changes the data, and also changes the results from those you get with alternative 2 (which only changes starting values, but data are unmodified). However, the effect is not very large and any Bayesian would claim that dissimilarity 1 is just a frequentist folly (you just haven't seen the case that is in common with these sampling units).
You change the maximum distance to missing values. This will change data more than alternative 3. It removes maximum dissimilarities and these no longer influence the decay curve. The effect is the same as censoring greatest dissimilarities. The results change more than in alternative 3.

How to add a column of labels to the right of a plot

I have code producing a swell plot in R. Check it out!
I made it using this code:
SwellPlot <- function(Data,P) {
par(mfcol=c(1,1), mar=c(4, 4.5, 0, 0) + 0.1)
plot(c(0.5,P+0.5), c(-0.5,P+0.5), type="n", cex=1, lab=c(20,20,1), cex.lab=1.5, yaxs="i", xaxs="i", xlab=~bold("Stuff!"), ylab=~bold("Other stuff!"))
for (f in 1:(P+1)) {
for (r in 0:P) {
points(r,(f-1), pch=15, cex=(60/P)*sqrt(Data[f,r]/200))
}
}
}
With Data input as a matrix, like this one used for the above example:
Data <- matrix(c(0, 117, 76, 7, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 199, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 188, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 90,
109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 38, 143, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 18, 142, 39, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 8, 114, 75, 3, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 4, 95, 99, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 68, 121, 7, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 65, 122, 10,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,
120, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, 42, 132, 23, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 35, 135, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 44, 128, 27, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 33, 139, 27, 1, 0, 0, 0, 0,
0, 0, 0, 0), 17, 16, byrow=FALSE)
I would like to glom a vertical series of labels along the right side of my swell plot (these labels are different than the y-axis labels, which I need to remain as they already are). I have done so by extending the x-axis and using text(), but when I do this it looks kludgy (on the x-axis labels) and because I have plots with quite variable x-axis lengths I have to spend a lot of trial and error time making sure that the width of my labels does not overlap the right-most plotted elements. The improved plot would look kinda like this:
I imagine that there must be some relatively straightforward way of doing this using layout() or mfcol or somesuch, but the documentation and examples get rapidly complex for me. How would you solve this?
Bonus points for answers that permit me to specifically (1) make the width of the label column I would like to add 8% of the width of my swell plot, and (2) make my swell plot (not including the labels up the right side) retain its 1:1 aspect ratio.
Also bonus points if this can be done using par and plot and the like.
Here is one possibility. You can either add rownames to your Data or you can pass in a vector of names
SwellPlot <- function(Data,P=nrow(Data), labels=!is.null(rownames(Data))) {
par(mfcol=c(1,1), mar=c(4, 4.5, 0, 3) + 0.1)
plot(c(0.5,P+0.5), c(-0.5,P+0.5),
type="n", cex=1, lab=c(20,20,1),
cex.lab=1.5, yaxs="i", xaxs="i",
xlab=~bold("Stuff!"), ylab=~bold("Other stuff!")
)
cex<-(60/P)*sqrt(Data/200)
points(col(Data), row(Data), pch=15, cex=cex)
if(is.logical(labels) && labels) {
labels = rownames(Data)
}
if(is.character(labels)) {
axis(4, labels=labels, at=1:P, las=1, tick=F)
}
}
#add names for labeling
lbl<-c("",rev(c("Ant","Bat","Cat","Dog","Eel","Fly","Gar","Hog")), rep("",8))
rownames(Data)<-lbl
SwellPlot(Data)
I just drew the extra names with axis and I made sure to make room for them by adjusting the par
I also edited the middle to take out the two loops. Those were pretty slow. You can do it all with one call to points passing all the x,y pairs at once. The trick is that if you pass a data.frame, it will convert it to a simple vector. So if all the matrices are arranges the same way, you'll get a point for each cell.

Resources