Add ExpressionFamily to cell_data_set - seurat

I used the as.cell_data_set to convert a seurat object to a monocle3 cell data set but it does not take into account the ExpressionFamily.
I need the ExpressionFamily in Monocle's plot_genes_in_pseudotime function. Is there a way to circumvent this or add the ExpressionFamily manually?
Please find below the error:
Error in cds_subset#expressionFamily#vfamily %in% c("negbinomial", "negbinomial.size") :
no slot of name "expressionFamily" for this object of class "cell_data_set"

Related

How to solve the wxGrid class no "findWindowById" function?

In the wxframe, there is one button and one "wxGrid" object.
I want to "click“ the function to change the "wxGrid".
But wxStaticText hasn't function for "findWindowById". Now I solve as follows
-record(wx_ref, {ref, type, state=[]}).
button_debug_a_click(Event,Object)->
A = wxWindow:findWindowById(?CONST_EQUIPMENT_GRID_ID),
B = A#wx_ref{type = wxGrid},
lager:debug("find equipment grid object:\t~p\t~p",[A,B]),
wxGrid:hide(B),
ok.
Only after it is converted to {wx_ref,45, wxGrid,[]}, it can be used.
But “wx_ref” record's header file can't be visited.
Is there a better way to solve the problem (convert id to object)

Assigning Value to StringValue In F#

I am working though this example of the Open XML SDK using F#
When I get to this line of code
sheet.Id = spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart)
I am getting a null ref exception when I implement it like this:
sheet.Id.Value <- document.WorkbookPart.GetIdOfPart(worksheetPart)
Is there another way to assign that value? System.Reflection?
I got it working like this:
let sheet = new Sheet
(
Id = new StringValue(spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart)),
SheetId = UInt32Value.FromUInt32(1u),
Name = new StringValue("mySheet")
)
If You want to take a look to the entire sample translated to F#, it's here.
To clarify what's going on, the problem is that sheet.Id is initially null. If we look at the following:
sheet.Id.Value <- document.WorkbookPart.GetIdOfPart(worksheetPart)
The code tries to access the sheet.Id and invoke its Value property setter, but the Id itself is null. The answer posted by Grzegorz sets the value of the whole Id property - it's done in a construtor syntax, but it's equivalent to writing the following:
sheet.Id <- new StringValue(spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart))
This sets the whole Id property to a new StringValue instance.

Error: Value of type 'String' has no member 'totalAnswered'

I am using CoreData for my project and I came into this error:
Error: Value of type 'String' has no member 'totalAnswered'
Here is my circumstance:
I have a CoreData model with the entity "Scores" and the ff. attributes:
datePlayed
totalScore
totalAnswered
I am using a table to show the data above.
Here is the problem part of my code for the Cell data:
if let date = score.datePlayed, let score = score.totalScore, let questions = score.totalAnswered {
I have no trouble saving into the entity "Scores" using the term "score" as illustrated in the code above. Also, I have no trouble showing the "score.datePlayed" and the "score.totalScore". However, the code "score.totalAnswered" is where I am having problems. It receives the error code above.
I have tried cleaning my project but the error still persist.
What should I do to show the data of "score.totalAnswered"?
EDIT:
I am using the code above to display the data using the ff. code:
cell.textLabel?.text = "Date: \(date)\nScore: \(score)/\(questions)"
Look at the 2nd let. You create a new variable named score that hides the original variable named score. So the 3rd let is trying to access the wrong score.
The best solution is to use a different variable name on the 2nd let.

Not able to get adjustToPickerWheelValue in xctest

I am trying to select a value in picker wheel but every time I type [app.pickerWheels.adjustToPickerWheelValue[#"Test"]];
Xcode says
Property 'adjustToPickerWheelValue' not found on object of type 'XCUIElementQuery'
How to resolve this issue ?
Here is the link i followed till now Link
UIElement Tree
adjustToPickerWheelValue is a method on XCUIElement, but you are using it on an XCUIElementQuery.
To get an XCUIElement, you must specify which picker wheel you want (even if there is only one).
let pickerWheel = app.pickerWheels.elementBoundByIndex(0)
pickerWheel.adjustToPickerWheelValue("some value")

'AnyObject' Doesn't have a Member "contactUID" Even thought Intelitype Says it Does?

Another ameture hour Swift Programming Question.
I have been returning values for an object from an array of object "Any Object" "Results". The intellitype says I have an object in the array with a value "ContactUID" however when I try to use ContactUID I get an error saying 'AnyObject' Doesn't contain member 'contactUID'.
The Array called HBCContactList successfully returns, FirstName, LastName and all the other items listed on the screen in the code. However it Will not return the Value 'ContactUID'.
The Model has got the right item. However unlike all the others... ContactUID is a INT64 instead of a string... I have added some screenshots to assit with the process of explaining. Sorry it sounds complicated but I expect I am missing something stupid.
Autocomplete on iOS isn't always accurate, often it will just list all possible selectors / methods.
The root of your problem here is that even though you know HCCContactList holds only HBCDirectoryModel objects, the compiler doesn't as MOContext.executeFetchRequest(freq, error: nil) returns an Array which declares it contains AnyObject's ([AnyObject] / Array<AnyObject>). In order to refer to any of these objects as an HBCDirectoryModel you'll need to conduct a cast to this type.
The easiest way to do this is is to declare your HCCContactList as being an array of HBCDirectoryModel's instead of AnyObject's, and then casting the result of calling MOContext.executeFetchRequest() to this same type.
You can do this as follows
var HCCContactList: Array<HBCDirectoryModel> = []
HCCContactList = MOContext.executeFetchRequest(freq, error: nil) as Array<HBCDirectoryModel>
Or using the shorter syntax
var HCCContactList:[HBCDirectoryModel] = []
HCCContactList = MOContext.executeFetchRequest(freq, error: nil) as [HBCDirectoryModel]

Resources