Differential Gene expression , trying to update the DGEList with estimate dispersion but fail - error-handling

I'm work on DGE right now and when I try to update my DGEList with the estimated dispersion, i got below error
dgelist_filtered_norm <- estimateDisp(dgelist_filtered_norm, design=design)
Error in as.vector(x, mode) :
cannot coerce type 'closure' to vector of type 'any'
how do I resolve this error? Thanks,

Related

mypy missed incompatible type in case of a pandas.DataFrame

I've tripped on mypy not complaining about incompatible types when DataFrame is involved. It's likely me being new to mypy, so please point me in the right direction.
I've simplified the case to the following code. My intuition tells me that both lines 12 and 13 should fail. But line 13: func(DataFrame()) for some reason passes.
from pandas import DataFrame
class T1:
pass
class T2:
pass
def func(arg: T2):
pass
func(T1())
func(DataFrame())
mypy mypy_sandbox.py
mypy_sandbox.py:12: error: Argument 1 to "func" has incompatible type "T1"; expected "T2" [arg-type]
Found 1 error in 1 file (checked 1 source file)
ok, maybe it's something missing in pandas for now (Dec 2021).
Based on the answer given by #user2640045, I've tried to install pandas-stubs and it solved my issue.
pip install pandas-stubs
Successfully installed pandas-stubs-1.2.0.39
mypy mypy_sandbox.py
mypy_sandbox.py:12: error: Argument 1 to "func" has incompatible type "T1"; expected "T2" [arg-type]
mypy_sandbox.py:13: error: Argument 1 to "func" has incompatible type "DataFrame"; expected "T2" [arg-type]
Found 2 errors in 1 file (checked 1 source file)

Error loading yelp dataset to postgreSQL

I'm trying to import the Yelp data from their sql file into a postgreSQL 10 database on Windoes by running the code:
psql -U postgres yelp_db < yelp_sql
and getting the errors below. As you can see it is probably due to the ` character. Is there any way to easy fix that? The file is 7.3GB so I'd like to avoid having to read it line by line to change the ` character to '.
ERROR: syntax error at or near "PaxHeader"
LINE 1: PaxHeader/yelp_db.sql17 uid=998889796
^
ERROR: syntax error at or near "`"
LINE 1: CREATE DATABASE /*!32312 IF NOT EXISTS*/ `yelp_db` /*!40100 ...
^
ERROR: syntax error at or near "USE"
LINE 1: USE `yelp_db`;
^
ERROR: syntax error at or near "`"
LINE 1: DROP TABLE IF EXISTS `attribute`;
^
ERROR: syntax error at or near "`"
LINE 1: CREATE TABLE `attribute` (

Pig Filter Syntax error, unexpected symbol

inputData = LOAD '$input' AS (line:chararray);
statusLineFilter = FILTER smallData BY (line MATHCES '^.* AppWrite-Dispatcher: Status code: [0-9]+$');
This code, when I run it, yields this error: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Syntax error, unexpected symbol at or near 'line'
The log file says the exact same thing. I'm at a loss, because the exact same syntax is working in other scripts I've written.
In order to avoid misspelling of key words I recommend you to use an IDE or a Text-Editor like emacs with the pig-mode.el which add syntax highlight ;)

Importing .sql file into SQLite

I'm trying to import a large .sql file into an SQLite .db file, but I'm getting the following errors:
sqlite> .read ./smsCorpus_en_2012.04.30.sql
Error: near line 23: near "COMMENT": syntax error
Error: near line 50: near "LOCK": syntax error
Error: near line 52: near "some1": syntax error
Error: near line 58: near "s": syntax error
Error: near line 60: near "s": syntax error
Error: near line 66: near "UNLOCK": syntax error
The file is located at http://wing.comp.nus.edu.sg:8080/SMSCorpus/data/corpus/smsCorpus_en_sql_2012.04.30.zip (direct file link) linked on this page http://wing.comp.nus.edu.sg:8080/SMSCorpus/history.jsp
EDIT: just a warning, the file is quite large...not sure if this is the issue?
That file is a MySQL dump.
To make SQLite understand it, you have to:
delete COMMENTs on the table fields;
remove AUTO_INCREMENT from id (INTEGER PRIMARY KEY fields are autoincrementing in SQLite anyway);
remove ENGINE and DEFAULT CHARSET;
remove LOCK/UNLOCK commands;
make the INSERT commands have fewer records;
replace \' quoting with ''.
That is a MySQL Dump and not SQLite.
There are slight variations on the syntax.

Syntax error when storing Pig output

I am having some issues with storing my pig output to a file. This is what I am using to store:
'STORE rel INTO 'simple'; '
If I Dump 'rel' I get:
>(car,0.5,(door,tire,jello,truck,random))
(toy,0.5,(jeep,bunny toy))
(door,0.5,(car,jello,random))
>(jeep,0.5,(toy,bunny toy))
What I get in the file is:
<Yulias-MacBook-Pro:~ yuliatolskaya$ /Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000 ; exit;
/Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000: line 1: syntax error near unexpected token `('
/Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000: line 1: `car 0.5 (door,tire,jello,truck,random)'
logout
[Process completed] >
I am really not sure what the problem is, as there are no errors in the logfiles...Please Help!