intermine / InterMineR

R package for InterMine
GNU Lesser General Public License v2.1
18 stars 16 forks source link

orderBy generates too many spaces in the newQuery method #57

Open yochannah opened 5 years ago

yochannah commented 5 years ago

This R code

# Create a new query
Pax6List = newQuery(
  #here we're choosing which columns of data we'd like to see
  view = c("Gene.primaryIdentifier",
           "Gene.symbol"),
  sortOrder = list("Gene.primaryIdentifier", "ASC"))

# Make a constraint: 
listConstraint = setConstraints(
  paths = c("Gene"),
  operators = c("IN"),
  values = list("PL_Pax6_Targets")
)

# Add the constraint to the query
Pax6List$where <- listConstraint

generates this XML:

<query name="" model="genomic" view="Gene.primaryIdentifier Gene.symbol" longDescription="" sortOrder=" Gene.primaryIdentifier  ASC">
  <constraint path="Gene" value="PL_Pax6_Targets" code="A" op="IN" extraValue=""/>
</query>

Note that there are too many spaces in sortOrder. The space space BEFORE Gene.primaryIdentifier is ignored, but there is also a double space between Gene.primaryIdentifier and ASC. This causes the InterMine server to throw a 400 error when it is run.