while designing matrix i got an error, please help me out
0
0
Entering edit mode
Rishav ▴ 20
@rishav-25031
Last seen 13 months ago
Patna

During performing analysis of my data, I got an error while designing the matrix. please help me out.

Here is the code that I run


#  condition_pairs <- t(combn(levels(HB$Treatment), 2))
Error in combn(levels(HB$Treatment), 2) : n < m

# Here is my metadata named HB

Run                 collection_time                        Sample Name               Treatment
SRR1984269  24h post-plating                            GSM1663548               Uninfected
SRR1984270  48h post-plating                        GSM1663549               Uninfected
SRR1984275  72h post-plating                            GSM1663554                Uninfected
SRR1984276  48h post-plating/24h post-infect    GSM1663555            AdGFP-infected
SRR1984279  48h post-plating/24h post-infect    GSM1663558            AdHBV-infected
SRR1984281  48h post-plating/24h post-infect    GSM1663560            AdHBV-infected
SRR1984285  72h post-plating/48h post-infection GSM1663564             AdHBV-infected
SRR1984271  48h post-plating                             GSM1663550                 Uninfected
SRR1984282  72h post-plating/48h post-infection GSM1663561             AdGFP-infected
SRR1984284  72h post-plating/48h post-infection GSM1663563              AdGFP-infected
SRR1984266  Freshly isolated/unplated           GSM1663545                    Uninfected
SRR1984280  48h post-plating/24h post-infect     GSM1663559           AdHBV-infected
SRR1984265  Freshly isolated/unplated            GSM1663544                  Uninfected
SRR1984267  Freshly isolated/unplated            GSM1663546                  Uninfected
SRR1984268  24h post-plating                             GSM1663547                 Uninfected
SRR1984272  48h post-plating                             GSM1663551                 Uninfected
SRR1984283  72h post-plating/48h post-infection  GSM1663562           AdGFP-infected
SRR1984286  72h post-plating/48h post-infection  GSM1663565            AdHBV-infected
SRR1984287  72h post-plating/48h post-infection  GSM1663566           AdHBV-infected
SRR1984273  72h post-plating                             GSM1663552                  Uninfected
SRR1984274  72h post-plating                             GSM1663553                Uninfected
SRR1984277  48h post-plating/24h post-infect     GSM1663556            AdGFP-infected
SRR1984278  48h post-plating/24h post-infect     GSM1663557             AdGFP-infected
RNASeqR • 1.5k views
ADD COMMENT
0
Entering edit mode

Can you tell us the output of class(HB$Treatment) ? It should be "factor"

ADD REPLY
0
Entering edit mode

The output of class HB($Treatment)

[1] "character"

ADD REPLY
0
Entering edit mode

Try class(HB$Treatment) <- "factor" and combn should work

ADD REPLY
0
Entering edit mode

you mean the code should be

condition_pairs <- combn(class(HB$Treatment), 2)
ADD REPLY
1
Entering edit mode

You should precise what is your expected output in your post as it is difficult to help you. If you want to remove the error you could do : condition_pairs <- t(combn(unique(HB$Treatment), 2))

ADD REPLY

Login before adding your answer.

Traffic: 878 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6