BioInforMatikz · project notebook ✦

Technology and digital projects

Build a sequence summary whose assumptions are visible.

A first bioinformatics portfolio project should make its inputs, calculation and limits inspectable. A small reproducible result is more persuasive than a notebook full of unexplained charts.

This JavaScript example reports GC percentage among A, C, G and T, while counting ambiguous symbols separately. It uses synthetic sequences, not patient data or a biological discovery claim.

Keep a tiny input you can check by hand

Save this complete synthetic example as sample.fasta.

Synthetic FASTA input

>sample_a
ACGTNN
>sample_b
GGCCTA

State the denominator in the code and the result

Save as gc-summary.mjs; run with Node.js: node gc-summary.mjs sample.fasta.

NCBI documents FASTA headers and nucleotide symbols. This teaching script accepts standard DNA ambiguity letters but excludes ambiguous positions from the GC denominator; other analyses may choose a different convention.

Complete original sequence-summary script

import { readFileSync } from 'node:fs';
const text = readFileSync(process.argv[2], 'utf8');
const records = [];
let current;
for (const raw of text.split(/\r?\n/)) {
  const line = raw.trim();
  if (!line) continue;
  if (line.startsWith('>')) {
    const id = line.slice(1).split(/\s+/)[0];
    if (!id || records.some(r => r.id === id)) throw Error('Missing or duplicate ID');
    current = { id, sequence: '' };
    records.push(current);
  } else {
    if (!current) throw Error('Sequence before header');
    const sequence = line.toUpperCase();
    if (!/^[ACGTRYSWKMBDHVN]+$/.test(sequence)) throw Error('Unsupported symbol');
    current.sequence += sequence;
  }
}
if (!records.length) throw Error('No sequences');
console.log('id,total,canonical,ambiguous,gc_percent');
for (const { id, sequence } of records) {
  if (!sequence.length) throw Error('Empty sequence: ' + id);
  const canonical = (sequence.match(/[ACGT]/g) || []).length;
  const gc = (sequence.match(/[GC]/g) || []).length;
  const percent = canonical ? (100 * gc / canonical).toFixed(2) : 'NA';
  console.log([id, sequence.length, canonical, sequence.length - canonical, percent].join(','));
}

Make the expected answer part of the project

The result is a calculation to verify, not a genome-quality verdict.

Expected CSV output

id,total,canonical,ambiguous,gc_percent
sample_a,6,4,2,50.00
sample_b,6,6,0,66.67

For sample_a, G and C occupy two of the four canonical positions. Reporting 33.33% would use all six positions instead, so the denominator changes the meaning.

A Bioinformatics Developer should show what happens with an all-ambiguous sequence, an empty record and a duplicate identifier. This script returns NA for the first and rejects the latter two.

Explain what would change for a real dataset

Computational biology includes the provenance and the failure cases.

For a larger genome sequencing dataset, document its source, accession or release, licence and file checksum. This example reads the whole file into memory and uses a simple duplicate check; it is deliberately not a production pipeline for large genomes.

If you are exploring Bioinformatics as a career in India, use the project to demonstrate reproducibility and reasoning rather than promising that one exercise qualifies you for Jobs. Show a meaningful next step, such as streaming input and validating against another documented tool.

External guides and references

Open the source for the part you want to examine further.