profile

Chatomics! — The Bioinformatics Newsletter

One character broke my TCGA pipeline


Hello Bioinformatics lovers,

Tommy here. First, I want to share two resources first before diving into today's topic.

Two resources to learn bioinformatics yourself:

1. Path to a free self-taught education in Bioinformatics! https://github.com/ossu/bioinformatics

2. Learning-bioinformatics-at-home https://github.com/harvardinformatics/learning-bioinformatics-at-home I started this repo 6 years ago at Harvard FAS informatics.

Free learning resources are abundant online, it is the desire to learn that is rare. Take Actions! Also, use ChatGPT or Claude as your learning companion.

Now, Let's dive in.

I lost an afternoon to a single character.

I was pulling TCGA lung squamous data with TCGAbiolinks, and my filter kept returning nothing.

The subtype field showed up two ways depending on when I looked at it. In the raw colData it was paper_Expression.Subtype with a dot. After I ran janitor::clean_names() it became paper_expression_subtype with underscores.

R treats the dot and the underscore as different characters, so a filter written for one name matched neither, and no error message warned me.

That was the small trap. The bigger one hides in missing values.

In TCGA clinical tables I have seen the same idea of "missing" written as [Not Available], as N/A, and as a bare dash.

On screen they read like gaps. To R they are ordinary text, so they slip through filters and break joins you assumed were clean. A real missing value prints as

Here is the routine I run before any PCA or UMAP.

First, I standardize the column names with janitor::clean_names() so a dot never competes with an underscore again.

Second, I convert the text placeholders to real NA. dplyr::na_if() handles one value per call, so for several placeholders I either nest the calls or set them at read time with readr::read_csv(na = c("[Not Available]", "N/A", "-")).

Third, I look at the column itself. Running janitor::tabyl() on it returns counts, percentages, and a visible

None of this is glamorous, and it is where most of my wasted hours have gone. Metadata is messier than any methods section admits, so I standardize early and inspect everything before I trust a single plot.

The full TCGA walk-through, with the code, is on the blog: https://rpubs.com/crazyhottommy/when_NA_is_not_NA

(What? it is almost 10 years ago! I am getting old)

What is the worst metadata bug you have hit?

Mine was a subtype column where one group showed up as Basal, basal-like, Basal_Like, and BASAL, four labels for the same thing. Hit reply and tell me yours. I read every response, and the sharpest ones show up in a future issue.

Happy Learning!

Tommy aka crazyhottommy

PS:

If you want to learn Bioinformatics, there are four ways that I can help:

  1. My free YouTube Chatomics channel, make sure you subscribe to it.
  2. I have many resources collected on my github here.
  3. I have been writing blog posts for over 10 years https://divingintogeneticsandgenomics.com/
  4. Lastly, I post everyday on Linkedin https://www.linkedin.com/in/%F0%9F%8E%AF-ming-tommy-tang-40650014/recent-activity/all/

Stay awesome!

Chatomics! — The Bioinformatics Newsletter

Why Subscribe?✅ Curated by Tommy Tang, a Director of Bioinformatics with 100K+ followers across LinkedIn, X, and YouTube✅ No fluff—just deep insights and working code examples✅ Trusted by grad students, postdocs, and biotech professionals✅ 100% free

Share this page