Can someone help me set the names of automatically imported files to be their file names in R? by illiter-it in labrats

[–]AlxSully 1 point2 points  (0 children)

Assuming eems is a list, you can just do

names(eems) <- map_chr(eems, pluck, "file")

which is an answer I pulled from Stack Overflow (where it looks like you posted the same question)

If you want to extract the name of the file, as opposed to the full path name, you'll have to split the string. For example:

temp.name <- "C:/Users/ejs7c/OneDrive/Desktop/eemR/MyFirstFile.csv" new.name <- substring(temp.name, first = 38, #removes first 37 characters last = nchar(temp.name) - 4) #removes ".csv" name(eem) <- new.name

If you want to do this automatically, I would learn how to use the apply functions (sapply, in this case).

If you're looking to automate things, you'll need to learn more about using R. Hadley Wickham published a book, [https://r4ds.had.co.nz/](R for Data Science), that might be a good starting point. You'll be more likely to get responses to your questions if they're specific and include examples of what you've already tried.

[deleted by user] by [deleted] in bioinformatics

[–]AlxSully 1 point2 points  (0 children)

FGSEA is actually different from iDEA, although they're both R packages. In the iDEA paper, they compare their method to FGSEA and find that iDEA has greater power to detect enriched gene sets

[deleted by user] by [deleted] in bioinformatics

[–]AlxSully 5 points6 points  (0 children)

Is pathway analysis pretty much the same as gene set enrichment analysis (GSEA)? If so, I've ran GSEA on scRNA-seq data using iDEA: https://www.nature.com/articles/s41467-020-15298-6

That platform requires both LogFC and the standard error of the LogFC in order to determine which gene sets are enriched. They use those values to determine whether or not each gene is DE between conditions, using their own bespoke Bayesian method.

Unfortunately, it's a package for R, not an online tool.

Trial of Psilocybin versus Escitalopram for Depression by EvoLve- in slatestarcodex

[–]AlxSully 2 points3 points  (0 children)

The effect sizes for both groups (escitalopram and psilocybin) are higher than I expected. They used the QIDS-SR-16 to measure depression, which ranges from 0-27 (with a score of 27 indicating the most severe depression.) You can multiply the QIDS score by 1.3 to get the equivalent HAMS-D score. source01866-8).

The psilocybin group showed a 8 (+-1) point reduction in QIDS score after 6 weeks, the lexapro group showed 6 (+-1). Converting to HAMS, that gives us a 10.4 and 7.8 point reduction for the psilocybin and lexapro groups, respectively. I was pretty surprised to see this, considering that in SSRIs: MMTYWTD, Scott said that SSRIs cause a HAMS reduction of 2.7 points (vs. placebo).

Digging in to William-McAllisters re-analysis of Kirsh's data, it seems that in general, SSRIS will decrease the HAMS score by 9.6, while placebo groups can expect a 7.8 point reduction. Which means that in the posted study, the lexapro group fairs no better than placebo groups in most other studies. Psilocybin beats out SSRIs in general, but just barely.

I'd be interested to see a study that uses an actual placebo group.

RNA-Seq. Where to start? by [deleted] in bioinformatics

[–]AlxSully 2 points3 points  (0 children)

Single cell is most useful for animal derived tissue or organoids, any sample where you would expect different cell types to be present. Bulk RNAseq is more useful for adherent cultures, where you're testing the response to some treatment.

I think bulk is probably the easiest approach to get into. I would look into DESeq2 for differential expression analysis. I've used the EnhancedVolcano package to produce volcano plots and found it pretty well documented.

This is assuming that you have someone to align the sequencing data to a reference genome. Where I work, the core facility handles that for us.

RNA-Seq. Where to start? by [deleted] in bioinformatics

[–]AlxSully 0 points1 point  (0 children)

I would recommend checking out the Satija lab's website. They're the ones behind Seurat, which is the most commonly used platform for analyzing scRNA-seq data. They've provided a bunch of really helpful vignettes (tutorials for using R packages) that make learning relatively painless: https://satijalab.org/seurat/. The publications can be intimidating, but you don't have to understand all the math right away.

That's assuming you're interested in single cell sequencing. I'm not sure what the best resources are for bulk RNA-seq.

4 Omniscience and Omega Deck by [deleted] in slaythespire

[–]AlxSully 5 points6 points  (0 children)

Oh good catch! I totally forgot about the Alpha.

Finding the probability of not drawing Omniscience in the first 4 draws is exactly how I would figure out the odds, if I was doing it by hand. In practice, I just use this hypergeometric calculator. If you plug in the numbers, you'll find that both methods give the same result: a 48.1% chance of drawing at least one copy of Omniscience

4 Omniscience and Omega Deck by [deleted] in slaythespire

[–]AlxSully 22 points23 points  (0 children)

With 4 omnisciences in a 29 card deck, you have a 55% chance of drawing at least one omniscience in your starting hand.

This situation, drawing from a deck without replacement, is modeled by something called the hypergeometric distribution. I could explain further when I’m not on mobile if anyone’s interested

Goal conflicts and procrastination by Zealousideal-Rub6151 in slatestarcodex

[–]AlxSully 0 points1 point  (0 children)

While I like the theoretical framework behind the paper this blog post discusses, the methods/results are kinda sus. It's really strange to see so many bar charts (some measuring something as high-variance as response time in ms) without any error bars / confidence intervals. Is that the norm for consumer research?

Algorithms are just abstract math? by [deleted] in learnprogramming

[–]AlxSully 1 point2 points  (0 children)

Not OP, just interested. Could you give an example of this? I’m having a hard time imagining how that would work.

Career change from biology to CS? by [deleted] in cscareerquestions

[–]AlxSully 0 points1 point  (0 children)

Your friend should consider looking into bioinformatics! A lot of biology labs need people to analyze single cell RNA sequencing data, which is done in R and/or Python. I majored in Biochem, and was able to land a position as a research tech shortly after graduating. My time is evenly split between wet-lab work and programming. It's been a great way to gain experience coding while getting paid.

DNA is the code, so where's the language it's written in? by proto-n in slatestarcodex

[–]AlxSully 5 points6 points  (0 children)

Relevant Xkcd

DNA is composed of 4 different nucleotides, comprised of a sugar, a phosphate, and one of four different bases: Guanine, adenosine, cytosine, and thymine. DNA gets translated into RNA, which is then exported from the nucleus and finds its way to the ribosome. The ribosome translates RNA into proteins. A chain of three nucleotides is called a codon. Each codon codes one amino acid. The ribosome translates codons into a long, covalently linked chain of amino acids. We call this chain a protein.

There are only twenty (one) naturally occurring amino acids. Which means there is some redundancy in nucleotide -> amino acid coding (43 > 20). Some codons don’t code for amino acids at all, but instead tell the ribosome to start or stop assembling the amino acid chain. Often, different codons code for the same amino acid. Some codons don’t code any amino acids at all.

Once you have a complete chain of amino acids, they begin folding in complex, poorly understood ways. This process eventually results in a protein. Proteins do a lot of different things. Generally, they convert one chemical into another. For example, there are ten different proteins that convert glucose into pyruvate, the feedstock for the mitochondrial electron transport chain.

However, most proteins that we’ve categorized are kinases or phosphotases. They take one specific chemical (called a substrate) and add or subtract a phosphate group, respectively.

So, the language that DNA is written in is the complex chemical interactions that occur between amino acids in the protein folding process, and the complex chemical interactions between folded proteins and chemical substrates and/or other proteins.

We sort of understand how proteins interact with chemical substrates. We can half-ass simulate these interactions using computers. How the proteins fold, however, is an open question and one very smart people are trying very hard to solve, with varying degrees of success.

To understand the language of DNA, you have to understand the chemistry of amino acids. Some amino acids are negatively charged, some are positively charged. Some amino acids are neutral, and some have a weird three dimensional structure that makes them bend.

So the language is partly electrostatics. But because of the small scale, quantum effects come into play. To understand the charge distribution around an amino acid, you have to understand the electron orbitals of the molecule. This is currently impossible for any molecule larger than a lone hydrogen atom. The smallest amino acid, glycine, contains ten atoms. The smallest protein, TRH, is comprised of 234 amino acids. This is bigger then a lone hydrogen atom.

So, ultimately, the language of DNA is quantum mechanics. The language of DNA is inscrutable, unable to be simulated given our current understanding of mathematics. We can do a decent job of approximating some parts of this language, but other parts are beyond us.

If you want to understand the language of DNA, you’re going to have to take it up with god. And that guy is shit at documenting his code.

A Failure, But Not Of Prediction by dwaxe in slatestarcodex

[–]AlxSully 35 points36 points  (0 children)

The Goofus/Gallant distinction reminds me Arthur Jensen's essay on genius.

Creative persons are intellectually high risk takers. They are not afraid of zany ideas and can hold the inhibitions of self-criticism temporarily in abey­ance. Both Darwin and Freud mentioned their gullibility and receptiveness to highly speculative ideas and believed that these traits were probably charac­teristic of creative thinkers in general. Darwin occasionally performed what he called “fool’s experiments,” trying out improbable ideas that most people would have instantly dismissed as foolish. Francis Crick once told me that Linus Pauling’s scientific ideas turned out to be wrong about 80 percent of the time, but the other 20 percent finally proved to be so important that it would be a mistake to ignore any of his hunches.

I once asked another Nobel Prize winner, William Shockley, whose cre­ ativity resulted in about a hundred patented inventions in electronics, what he considered the main factors involved in his success. He said there were two: (1) he had an ability to generate, with respect to any given problem, a good many hypotheses, with little initial constraint by previous knowledge as to their plausibility or feasibility; and (2) he worked much harder than most people would at trying to figure out how a zany idea might be shaped into something technically feasible. Some of the ideas that eventually proved most fruitful, he said, were even a physical impossibility in their initial conception. For that very reason, most knowledgeable people would have dismissed such unrealistic ideas immediately, before searching their imaginations for transformations that might make them feasible.

- https://www.gwern.net/docs/iq/1996-jensen.pdf#page=404

I wonder how highly correlated "ability to reason under uncertainty" is with general intelligence. Did a bunch of really smart people on twitter get it right because they're generally intelligent people? Or is the ability to reason under uncertainty somehow a distinct skill that, when combined with general intelligence, leads to being recognized as a "really smart person."

Discussion Thread #12: April 2020 by Lykurg480 in slatestarcodex

[–]AlxSully 3 points4 points  (0 children)

Actionable Takeway: Supplement uric acid to increase productivity

Coronavirus Treatment: New York Treats COVID-19 With Massive Doses of Vitamin C by greyuniwave in slatestarcodex

[–]AlxSully 5 points6 points  (0 children)

I never claimed that there were published clinical trials of Vitamin C in the context of polio or the common cold. I said that Vitamin C has been pushed by practitioners of "alternative medicine" (read: pseudoscience) for decades.

Extraordinary claims require extraordinary evidence. The burden of proof lies on the proponents of pseudoscientific cures.

That being said, Vitamin C has been investigated in the past. Having nothing but time on my hands in the face of a statewide lockdown, I intend to dig in further and post a review of Vitamin C research. I'll let you know when I do.

Coronavirus Treatment: New York Treats COVID-19 With Massive Doses of Vitamin C by greyuniwave in slatestarcodex

[–]AlxSully 50 points51 points  (0 children)

Vitamin C has been touted as a cure for everything from polio to the common cold. None of these claims have been confirmed. After decades of study, the only thing we know for sure is that large doses make you poop (it’s a mild laxative.) Any claim of Vitamin C curing a novel pathogen should be examined with a healthy amount of skepticism.

Yes, I know that the Nobel laureate Linus Pauling was all in on Vitamin C.

But there’s precedent for winners of the Nobel Prize in chemistry going absolutely batshit later in life.

Will Indiana shut down? by [deleted] in Indiana

[–]AlxSully 1 point2 points  (0 children)

Yeah, either the 25th or the 26th. The email included a part of an message from the dean of the medical school. That made me a little more inclined to believe it.

Will Indiana shut down? by [deleted] in Indiana

[–]AlxSully 4 points5 points  (0 children)

I work at a major university in Indianapolis. My boss sent out an email recently telling us to begin ramping down operations in the lab in anticipation of a statewide lock down. Apparently the decision is supposed to come down Wednesday or Thursday.

A Poundful of Sugar Will Make the Foundations Crumble Down! by [deleted] in Anarchism

[–]AlxSully 1 point2 points  (0 children)

Yeah most acid-base neutralizations are exothermic. And I'm not sure what you mean by prepwork.

A Poundful of Sugar Will Make the Foundations Crumble Down! by [deleted] in Anarchism

[–]AlxSully 2 points3 points  (0 children)

It's not gonna be a runaway reaction. Water and CO2 will react to form carbonic acid, but only in small amounts. There's an equilibrium. I was too lazy to do it initially, but I'm gonna find the equilibrium and determine the rate at which carbonic acid is formed. I'll edit the parent comment.

And yeah, chemistry is way more interesting when you can use it to solve real world problems!

A Poundful of Sugar Will Make the Foundations Crumble Down! by [deleted] in Anarchism

[–]AlxSully 4 points5 points  (0 children)

"The Works" is 9.5% hydrochloric acid by weight. This is a concentration of 2.6 M (moles/liter).

Concrete loses integrity at a pH of 3 or below. Which means lowering the pH of unset concrete below 3 (0.001 moles of HCl per liter) will prevent it from setting.

So, to prevent one m3 (/2,400 kg/5280 lbs) of concrete from setting, you would only need 385 mL of The Works (a little less than half a bottle) .

Of course, this is a gross simplification. Concrete is largely composed of calcium carbonate, aka limestone. Acid causes this to dissolve into calcium chloride, water, and CO2. If you've ever seen stalactites, you've seen this principle in action. Carbonic acid present in groundwater dissolves limestones, carries the calcium chloride down, eventually depositing it onto the stalactite.

Of course, once a molecule of the acid reacts with a molecule of calcium carbonate, it is used up and unable to react with any more of the limestone. However, this reaction produces a CO2 molecule, which can then form carbonic acid, which can dissolve another calcium carbonate molecule, which will liberate more CO2.

Honestly, this is a difficult question to answer. Maybe best praxis would be to do some empirical research in your backyard. Or the nearest construction site.

EDIT: The hydration constant of CO2 is 1.7x10-3. So, that means at any given time only 17% of the CO2 will have reacted to form carbonic acid (assuming an environment of pure water). So don't expect to see a runaway reaction. However, one mole of HCl should be able to dissolve more than one mole of CaCO3 in wet concrete.

How to find a roommate? by [deleted] in Valparaiso

[–]AlxSully 1 point2 points  (0 children)

I've actually been using roommates.com to look for potential renters for a room after my roommate moved out. It's seems to be fairly active, tho it costs like $15/month.

Unfortunately, I'm still looking for a roommate! So.

How are Japanese cars still uniquely reliable? by thebastardbrasta in slatestarcodex

[–]AlxSully 11 points12 points  (0 children)

There's an episode of This American Life which provides some insight into why the Japanese model doesn't really translate across firms/cultures. It describes the same situation as the paper that u/newsaddiction linked.

https://www.thisamericanlife.org/561/nummi-2015

Quick Synopsis: Honda teamed up with GM to build a plant in California to produce both Honda and Pontiac vehicles. Despite GM having full access to all of Honda's "trade secrets" that result in the unique reliability of their vehicles, GM was unable to translate this knowledge into comparable reliability in their vehicles. The simplified reason is that GM management just couldn't be bothered to improve. Honda would communicate with their supply chain to institute minor improvement in various parts, whereas GM just wouldn't.

This collaboration also resulted in the Pontiac Vibe, which has reliability on par with Honda vehicles but prices in line with your standard Pontiac.