Skip to content

Commit

Permalink
Remove check for ref ann file as now optional
Browse files Browse the repository at this point in the history
  • Loading branch information
adamd3 committed Jan 22, 2024
1 parent f3bf4f4 commit 4421e32
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bin/merge_kallisto_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def merge_counts(
gene_lengths = gene_lengths.rename(columns={"feature_id": "locus_tag"})
quant_merged = quant_merged[["feature_id"] + metadata["sample"].tolist()]
# export merged counts
outf1 = os.path.join(out_dir, "gene_counts.tsv")
outf1 = os.path.join(out_dir, "gene_counts1.tsv")
quant_merged.to_csv(outf1, index=False, sep="\t")
# # gene annotation df for extracting protein-coding genes
# annot_dat = (gffpd.read_gff3(gff_f)).df
Expand Down
2 changes: 1 addition & 1 deletion bin/normalise_counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ outdir <- opt$outdir
# stringsAsFactors = FALSE
# )

counts_tab <- read_tsv("gene_counts_pc1.tsv")
counts_tab <- read_tsv("gene_counts_pc.tsv")
ref_gene_tab <- read_tsv("ref_gene_df.tsv")

gene_names <- counts_tab[["feature_id"]]
Expand Down
9 changes: 0 additions & 9 deletions bin/pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,16 @@ meta_tab$group <- as.factor(as.character(meta_tab$group))
## order rows to match counts columns
meta_tab <- meta_tab[match(colnames(norm_counts), meta_tab$sample), ]

cat(colnames(norm_counts), file = stderr())
cat(dim(norm_counts), file = stderr())


## ------------------------------------------------------------------------------
## PCA
## ------------------------------------------------------------------------------
pca_counts <- prcomp(t(norm_counts), center = TRUE, scale = FALSE)

cat(colnames(pca_counts), file = stderr())
cat(dim(pca_counts), file = stderr())

pca_coords <- data.frame(pca_counts$x)
pca_coords$sample <- rownames(pca_coords)

cat(colnames(pca_coords), file = stderr())
cat(dim(pca_coords), file = stderr())


# move sample to first column
pca_coords <- pca_coords[c(
"sample", colnames(pca_coords)[1:ncol(pca_coords) - 1]
Expand Down

0 comments on commit 4421e32

Please sign in to comment.