# R session aborted when running random\_effect

**URL:** <https://forum.biobakery.org/t/r-session-aborted-when-running-random-effect/6211>\
**Category:** MaAsLin\
**Created:** [November 16, 2023, 3:05am UTC](https://forum.biobakery.org/t/r-session-aborted-when-running-random-effect/6211 "2023-11-16T03:05:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanhoadn](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@tanhoadn](https://forum.biobakery.org/u/tanhoadn)\
**Post date:** [November 16, 2023, 3:05am UTC](https://forum.biobakery.org/t/r-session-aborted-when-running-random-effect/6211/1 "2023-11-16T03:05:19Z")

</div>

Hi everyone,

I have a problem with paired sample when running Maasslin2.

I am a newbie and I have a count dataset with paired sample (tumor and non-tumor) for each subject. I run Maaslin2 with Subject as a random effect and Group (tumor and non-tumor) as fixed effects, but R session aborted (R encountered a fatal error). But when I run with just fixed effect, Maaslin2 run completely.

This is Maaslin2 code:  
Maaslin2(  
input\_data, input\_metadata, output,  
min\_prevalence = 0.1,  
normalization = “TMM”,  
transform = “NONE”,  
analysis\_method = “NEGBIN”,  
fixed\_effects = c(“Group”),  
random\_effects = c(“Subject”),  
reference=c(“Group,non.tumor”)  
)

Is something wrong?

Hope to receive help from everyone!

tanhoadnt

---

<div class="post-metadata">

**Author:** ![nearinj](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/nearinj/32/2135_2.png) [@nearinj](https://forum.biobakery.org/u/nearinj)\
**Post date:** [November 20, 2023, 5:09pm UTC](https://forum.biobakery.org/t/r-session-aborted-when-running-random-effect/6211/2 "2023-11-20T17:09:19Z")

</div>

Hi there @tanhoadn,

Unfortunately I cannot really work out why this is occurring without a reproducible example would you be able to share some data that causes this? One thing to check would be if there are any odd characters in the sample name or metadata.

Cheers,  
Jacob Nearing

---

<div class="post-metadata">

**Author:** ![tanhoadn](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@tanhoadn](https://forum.biobakery.org/u/tanhoadn)\
**Post date:** [November 21, 2023, 11:02am UTC](https://forum.biobakery.org/t/r-session-aborted-when-running-random-effect/6211/3 "2023-11-21T11:02:20Z")

</div>

Hi @nearinj

Thank you for your reply!

I send you a part of my data. Hope you can check and help me to see where the problem is.

[df.20.csv](https://forum.biobakery.org/uploads/short-url/iCs7EZ0zXE9DqJLhKg9pw44fGNy.csv) (502 Bytes)  
[otu.20.csv](https://forum.biobakery.org/uploads/short-url/rAxetnuZpOBKfhRybZN9tm4vuZc.csv) (15.6 KB)

Many thanks,  
tanhoadn

---

<div class="post-metadata">

**Author:** ![vicky291](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/vicky291/32/2531_2.png) [@vicky291](https://forum.biobakery.org/u/vicky291)\
**Post date:** [December 4, 2023, 10:57pm UTC](https://forum.biobakery.org/t/r-session-aborted-when-running-random-effect/6211/4 "2023-12-04T22:57:54Z")

</div>

I ran into the same issue where the model without random\_effect (batch variable in my case) works fine, but when I ran the model including random\_effect option, my R session aborted. We may have different causes for the problems, but I’m curious if you have solved the issue. If so, how?

Thank you!  
Vicky

---

<div class="post-metadata">

**Author:** ![tanhoadn](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@tanhoadn](https://forum.biobakery.org/u/tanhoadn)\
**Post date:** [December 6, 2023, 12:25am UTC](https://forum.biobakery.org/t/r-session-aborted-when-running-random-effect/6211/5 "2023-12-06T00:25:16Z")

</div>

Hi @vicky291

I have not known where the problem is. But when I exported input.csv and metadata.csv, then I ran it in a new R session (just run for Maaslin package), it worked. Hope this helps!

Best,  
tanhoadn
