- Create new account
- Request new password
- Problem with Satorra-Bentler Chi-Squared in WLS
- OpenMx 2.20 released!
- OpenMx 2.19.8 released!
- OpenMx 2.19 released!
- OpenMx 2.18 released!
- OpenMx 2.17 released!
- OpenMx 2.15 released!
- OpenMx 2.14 released!
- OpenMx 2.13 released!
- OpenMx 2.12 released!
- Feed aggregator
You are here
Weirdness with and without : assignment of an object of class "numeric" is not valid for slot "values" in an object of class.
The following indicates that assignment of numeric values to an @values part of an mxMatrix only works when the  are there. When they are not there (which used to work fine) we get an error:
> DirectionofCausationBcausesA$ACE.B@values [,1] [,2] [1,] 0 0 [2,] 0 0 > DirectionofCausationBcausesA$ACE.B@values [,1] [,2] [1,] 0 0 [2,] 0 0 > > DirectionofCausationBcausesA$ACE.B@values<-0 Error in checkSlotAssignment(object, name, value) : assignment of an object of class "numeric" is not valid for slot "values" in an object of class "FullMatrix"; is(value, "matrix") is not TRUE > > > DirectionofCausationBcausesA$ACE.B@values [,1] [,2] [1,] 0 0 [2,] 0 0 > > DirectionofCausationBcausesA$ACE.B@values<-0
- Log in or register to post comments
This is not a bug. The slots of a S4 object are typed objects. They are possibly the only objects in R that are typed objects. '0' is a numeric vector, while ACE.B@values expects a matrix type. Therefore the assignment ACE.B@values <- 0 is necessary.
An analogy would be:
Copyright © 2007-2023 The OpenMx Project
- Can't solve dimname associated error
- The goal of moderator analysis in metaSEM::wls()
- when to standardize?
- Moderator analyses in OSMASEM
- Can´t get the fit indices for DoC model, as Saturated DZ gets non pos def
- Is osmasem3 in the github version of metaSEM?
- MetaSEM with odds ratios
- Can't derive CIs in multiple groups twin model. Too nested!
- impact of ignoring higher level clustering
- Degrees of freedom with raw data
I'm wrestling with tximport/DESeq2. I've create a small experiment dataset of 2 paired end fastq, generated counts with salmon, and successfully read them in with tximport (or so I think). "files" is my list of 2 quant.sf files. tx2gene is the obvious.
> dds <- DESeqDataSetFromTximport(txi, sampleTable, ~tissue) Error in checkSlotAssignment(object, name, value) : assignment of an object of class "NULL" is not valid for slot 'NAMES' in an object of class "DESeqDataSet"; is(value, "characterORNULL") is not TRUE
I've just recently installed R 3.4.0 and have update all packages. I see that there was some changes in S4 of renaming characterORNULL to character_OR_NULL; is this the issue?
Thanks for the response.
biocLite() looks clean:
For a brief time, I thought my problem was that I was no pulling in tximportData. But adding that did not help.
Should I be concerned that the Class is -none- in the DESeqDataSet?
The error message almost makes sense if it's happening from trying to act on a null class.
Incidentally, I see that makeExampleDESeqDataSet() also returns the same error for me
That's useful for debugging, isolating the problem to DESeq2 or its depends. Can you call traceback() after the error and post here?
RangedSummarizedExperiment has character_OR_NULL and DESeq2 has characterORNULL. I thought the latter was obsolete. This is also the one that shows up in the error message.
I'm starting to get more suspicious of the change in the S4Vectors package. Renaming characterORNULL to character_OR_NULL happened in 0.14.0 9 days ago.
What is your version of S4Vectors?
Does BiocInstaller::biocValid() point to any problems?
@JWCarlson found the workaround.. (he hit the 5-post limit)
The DESeq2 package will need to be tweaked to account for the latest change in S4Vectors. Creating the class definitions: setClassUnion("characterORNULL", c("character", "NULL”)) setClassUnion(“DataTableORNULL", c(“DataTable", "NULL”)) These were defined in the old S4Vectors but not in the latest version.
That is not the right solution. The slot NAMES comes from SummarizedExperiment; does SummarizedExperiment::SummarizedExperiment() work? Does getClass("SummarizedExperiment") show character_or_NULL ? Are there two versions of SummarizedExperiment installed, maybe tested with
Thanks Martin for helping to dive into this.
I just updated all Bioc packages on my machine and DESeq2 builds and passes CHECK as it does on Bioc servers.
I recognize that my setClassUnion call is a hack. It's a workaround until this gets sorted out and something to convince me that this really is the issue.
In answer to your questions, the constructor works and it shows character_OR_NULL. (As does RangedSummarizedExperiment; DESeqDataSet show NAMES is characterORNULL). And it looks like I have only 1 version installed.
Here is what I get for the NAMES slot of DESeqDataSet today. I don't believe that the version bump in SummarizedExperiment is relevant.
Can you run biocLite() once again to grab any changes since the release?
The DESeqDataSetFromTximport example is working fine on the Bioc machines and on mine:
Thanks for your work on this Michael.
This is what I upgraded:
I updated all. If I take out my setClassUnion hack, I still see:
It still works with my hack in place.
I'm kind of baffled. It seems like there is an older version of some packages sneaking in, but I don't know how or why.
Yes. It's a strange thing. When I look at showClass("DESeqDataSet"), NAMES is charcterORNULL. But your results show that it is character_OR_NULL.
I agree that from all appearances, my initialization of DESeqDataSet looks like it's pulling in an older version of S4Vectors. I've stepped through the initialization of DESeqDataSet and it looks to me that NAMES in S4Vectors inside the initialization of DESeqDataSet is characterORNULL. But I cannot find where that is done. I'll look some more and see if I can find it.
I had this issue. Turns out I had the new version installed on my machine as the root user but an older version of DESeq2 and BioCinstaller in my ~/R/x86_64-pc-linux-gnu-library/3.4. Manually removed the packages from my users local R library and reran bioClite() then it worked.
Login before adding your answer.
- Skip to main content
- Skip to search
- Skip to select language
- Sign up for free
- English (US)
Private properties were not native to the language before this syntax existed. In prototypical inheritance, its behavior may be emulated with WeakMap objects or closures , but they can't compare to the # syntax in terms of ergonomics.
There are some additional syntax restrictions:
- All private identifiers declared within a class must be unique. The namespace is shared between static and instance properties. The only exception is when the two declarations define a getter-setter pair.
- The private identifier cannot be #constructor .
Most class properties have their private counterparts:
Private methods, private static fields, private static methods.
- Private getters
- Private setters
- Private static getters
- Private static setters
Private properties are declared with # names (pronounced "hash names"), which are identifiers prefixed with # . The hash prefix is an inherent part of the property name — you can draw relationship with the old underscore prefix convention _privateField — but it's not an ordinary string property, so you can't dynamically access it with the bracket notation .
It is a syntax error to refer to # names from outside of the class. It is also a syntax error to refer to private properties that were not declared in the class body, or to attempt to remove declared properties with delete .
If you access a private property from an object that doesn't have the property, a TypeError is thrown, instead of returning undefined as normal properties do.
This example also illustrates that you can access private properties within static functions too, and on externally defined instances of the class.
You can use the in operator to check whether an externally defined object possesses a private property. This will return true if the private field or method exists, and false otherwise.
Note a corollary of private names being always pre-declared and non-deletable: if you found that an object possesses one private property of the current class (either from a try...catch or an in check), it must possess all other private properties. An object possessing the private properties of a class generally means it was constructed by that class (although not always ).
Private properties are not part of the prototypical inheritance model since they can only be accessed within the current class's body and aren't inherited by subclasses. Private properties with the same name within different classes are entirely different and do not interoperate with each other. See them as external metadata attached to each instance, managed by the class. For this reason, Object.freeze() and Object.seal() have no effect on private properties.
For more information on how and when private fields are initialized, see public class fields .
Private fields include private instance fields and private static fields. Private fields are only accessible from inside the class declaration.
Private instance fields
Like their public counterparts, private instance fields:
- are added before the constructor runs in a base class, or immediately after super() is invoked in a subclass, and
- are only available on instances of the class.
Note: #privateField from the ClassWithPrivateField base class is private to ClassWithPrivateField and is not accessible from the derived Subclass .
Returning overriding object
A class's constructor can return a different object, which will be used as the new this for the derived class constructor. The derived class may then define private fields on that returned object — meaning it is possible to "stamp" private fields onto unrelated objects.
Warning: This is a potentially very confusing thing to do. You are generally advised to avoid returning anything from the constructor — especially something unrelated to this .
Like their public counterparts, private static fields:
- are added to the class constructor at class evaluation time, and
- are only available on the class itself.
There is a restriction on private static fields: only the class which defines the private static field can access the field. This can lead to unexpected behavior when using this . In the following example, this refers to the Subclass class (not the ClassWithPrivateStaticField class) when we try to call Subclass.publicStaticMethod() , and so causes a TypeError .
This is the same if you call the method with super , because super methods are not called with the super class as this .
You are advised to always access private static fields through the class name, not through this , so inheritance doesn't break the method.
Private methods include private instance methods and private static methods. Private methods are only accessible from inside the class declaration.
Private instance methods
Unlike their public counterparts, private instance methods:
- are installed immediately before the instance fields are installed, and
- are only available on instances of the class, not on its .prototype property.
Private instance methods may be generator, async, or async generator functions. Private getters and setters are also possible, and follow the same syntax requirements as their public getter and setter counterparts.
Unlike public methods, private methods are not accessible on the .prototype property of their class.
Like their public counterparts, private static methods:
Private static methods may be generator, async, and async generator functions.
The same restriction previously mentioned for private static fields holds for private static methods, and similarly can lead to unexpected behavior when using this . In the following example, when we try to call Subclass.publicStaticMethod() , this refers to the Subclass class (not the ClassWithPrivateStaticMethod class) and so causes a TypeError .
Simulating private constructors
- Using classes guide
- Public class fields
- Private Syntax FAQ in the TC39 class-fields proposal
- The semantics of all JS class elements by Shu-yu Guo (2018)
- Public and private class fields on v8.dev (2018)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Handle null for class's object
I have the following in my class which gets the data from my database:
The problem is that sometimes it's null and therefore the app will fail to run.
How can I handle the null here?
but it's not valid
Can you show us the logic that queries the DB/populates that field? What's the data type of the database column that this field maps to?
This is the error:
System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.List`1[Root]. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
The code is:
The class is for Stripe result and it's attached as PDF because it's large to paste here..
Mind posting the JSON / Root class?
Sorry, updated in my reply above.
It's worth copying the JSON to a local file, then stripping out properties to isolate the offending part. It's hard to help diagnose without seeing the JSON
If this happens often and it's Deserialize which is throwing the exception, consider wrapping this in a try-catch, write the json to a log file then work backwards to the data in the database to see why there is an issue with the json.
Here is the JSON
Try deserialising as Root rather than List<Root> :
Yes it's working. Thank you
Search code, repositories, users, issues, pull requests...
We read every piece of feedback, and take your input very seriously.
Use saved searches to filter your results more quickly.
To see all available qualifiers, see our documentation .
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in checkSlotAssignment(object, name, value) #44
xuesongjing commented May 22, 2017
JEFworks commented May 22, 2017
Sorry, something went wrong.
mittalan commented Apr 2, 2020 • edited
No branches or pull requests
Error in (function (cl, name, valueClass) :assignment of an object of class “numeric” is not vali...
Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘data.signaling’ in an object of class “CellChat”; is(value, "AnyMatrix") is not TRUE
- 人面猴 序言：七十年代末，一起剥皮案震惊了整个滨河市，随后出现的几起案子，更是在滨河造成了极大的恐慌，老刑警刘岩，带你破解... 沈念sama 阅读 106,043 评论 1 赞 221
- 死咒 序言：滨河连续发生了三起死亡事件，死亡现场离奇诡异，居然都是意外死亡，警方通过查阅死者的电脑和手机，发现死者居然都... 沈念sama 阅读 43,711 评论 1 赞 188
- 救了他两次的神仙让他今天三更去死 文/潘晓璐 我一进店门，熙熙楼的掌柜王于贵愁眉苦脸地迎上来，“玉大人，你说我怎么就摊上这事。” “怎么了？”我有些... 开封第一讲书人 阅读 59,203 评论 0 赞 142
- 道士缉凶录：失踪的卖姜人 文/不坏的土叔 我叫张陵，是天一观的道长。 经常有香客问我，道长，这世上最难降的妖魔是什么？ 我笑而不... 开封第一讲书人 阅读 29,895 评论 0 赞 114
- 港岛之恋（遗憾婚礼） 正文 为了忘掉前任，我火速办了婚礼，结果婚礼上，老公的妹妹穿的比我还像新娘。我一直安慰自己，他们只是感情好，可当我... 茶点故事 阅读 36,199 评论 0 赞 188
- 恶毒庶女顶嫁案：这布局不是一般人想出来的 文/花漫 我一把揭开白布。 她就那样静静地躺着，像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上，一... 开封第一讲书人 阅读 29,994 评论 1 赞 109
- 城市分裂传说 那天，我揣着相机与录音，去河边找鬼。 笑死，一个胖子当着我的面吹牛，可吹牛的内容都是我干的。 我是一名探鬼主播，决... 沈念sama 阅读 22,159 评论 2 赞 191
- 双鸳鸯连环套：你想象不到人心有多黑 文/苍兰香墨 我猛地睁开眼，长吁一口气：“原来是场噩梦啊……” “哼！你这毒妇竟也来了？” 一声冷哼从身侧响起，我... 开封第一讲书人 阅读 21,420 评论 0 赞 108
- 父亲被人害死了，幕后凶手却是我最亲的人！ 想象着我的养父在大火中拼命挣扎，窒息，最后皮肤化为焦炭。我心中就已经是抑制不住地欢快，这就叫做以其人之道，还治其人... 爱写小说的胖达 阅读 20,246 评论 5 赞 151
- 万荣杀人案实录 序言：老挝万荣一对情侣失踪，失踪者是张志新（化名）和其女友刘颖，没想到半个月后，有当地人在树林里发现了一具尸体，经... 沈念sama 阅读 24,075 评论 0 赞 161
- 护林员之死 正文 独居荒郊野岭守林人离奇死亡，尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日... 茶点故事 阅读 21,663 评论 1 赞 153
- 白月光启示录 正文 我和宋清朗相恋三年，在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。... 茶点故事 阅读 22,867 评论 1 赞 161
- 惨遭霸总抛弃后，我靠赚来的钱成了富豪榜第一名 白月光回国，霸总把我这个替身辞退。还一脸阴沉的警告我。[不要出现在思思面前， 不然我有一百种方法让你生不如死。]我... 爱写小说的胖达 阅读 17,398 评论 0 赞 21
- 活死人 序言：一个原本活蹦乱跳的男人离奇死亡，死状恐怖，灵堂内的尸体忽然破棺而出，到底是诈尸还是另有隐情，我是刑警宁泽，带... 沈念sama 阅读 20,061 评论 2 赞 149
- 日本核电站爆炸内幕 正文 年R本政府宣布，位于F岛的核电站，受9级特大地震影响，放射性物质发生泄漏。R本人自食恶果不足惜，却给世界环境... 茶点故事 阅读 23,614 评论 3 赞 156
- 男人毒药：我在死后第九天来索命 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹，春花似锦、人声如沸。这庄子的主人今日做“春日... 开封第一讲书人 阅读 18,626 评论 0 赞 4
- 一桩弑父案，背后竟有这般阴谋 文/苍兰香墨 我抬头看了看天上的太阳。三九已至，却和暖如春，着一层夹袄步出监牢的瞬间，已是汗流浃背。 一阵脚步声响... 开封第一讲书人 阅读 19,009 评论 0 赞 104
- 情欲美人皮 我被黑心中介骗来泰国打工， 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留，地道东北人。 一个月前我还... 沈念sama 阅读 24,634 评论 2 赞 170
- 代替公主和亲 正文 我出身青楼，却偏偏与公主长得像，于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子，可洞房花烛夜当晚... 茶点故事 阅读 25,068 评论 2 赞 171
- 2018-7-18，晚上，7:00-8:30，注音标3-1-3，口语滚动复习。 xin_8008 阅读 4,476 评论 1 赞 2
- 有效教学（摘记八）——崔允漷 第八章 教学评价 第一节 从考试文化走向评价文化 一、教学评价的早期发展 （一）传统考试阶段 ★《学记》——我国最... Dreamerr__ 阅读 4,714 评论 1 赞 6
- 张艺谋要在电影院开“画展”，预告片孙俪都是戏，关晓彤可期待！ 今天青石的票圈出镜率最高的，莫过于张艺谋的新片终于定档了。 一张满溢着水墨风的海报一次次的出现在票圈里，也就是老谋... 青石电影 阅读 10,148 评论 1 赞 3
- 2018-07-18 今天主要学习了flex布局，学习笔记如下： 1.指定flex布局： display：flex(任意容器)... riku_lu 阅读 3,069 评论 2 赞 3
- 《自然门插打法与螳螂拳采手》 插打法原为少林六合门打法，一代宗师万籁声将少林六合门、罗汉门、自然门等内外家之所长融为一家，自然门本无固定招式，然... 梁山的洛奇 阅读 4,522 评论 1 赞 2