How to perform a column by column circular shift of a matrix without a loop
By : Ilche Ivanovski
Date : March 29 2020, 07:55 AM

Importing multiple csv files and extracting one column of data to form a single matrix
By : Madhu kakarla
Date : March 29 2020, 07:55 AM

How to convert single column data into twocolumn matrix using conditional/for loop in R
By : kaleem yousafzai
Date : March 29 2020, 07:55 AM
should help you out Although I will stick with packages, here is a solution initialize data code :
mydf < data.frame(x=c(">PROKKA_00002 Alphaketoglutarate","MTESSITERGAPEL", "MTESSITERGAPEL",">PROKKA_00003 lipoprotein", "MTESSITERGAPEL" ,"MRTIIVIASLLLT"), stringsAsFactors = F)
ind < grep(">", mydf$x)
temp<data.frame(ind=ind, from=ind+1, to=c((ind1)[1], nrow(mydf)))
seqs<rep(NA, length(ind))
for(i in 1:length(ind)) {
seqs[i]<paste(mydf$x[temp$from[i]:temp$to[i]], collapse="")
}
fastatable<data.frame(name=gsub(">", "", mydf[ind,1]), sequence=seqs)
> fastatable
name sequence
1 PROKKA_00002 Alphaketoglutarate MTESSITERGAPELMTESSITERGAPEL
2 PROKKA_00003 lipoprotein MTESSITERGAPELMRTIIVIASLLLT

AWK: finding common elements across arbitrary number of columns (either single column files or column matrix)
By : Júlio Leitão Jr.
Date : March 29 2020, 07:55 AM
should help you out Problem , to find what elements are contained across all files code :
#Store the files in an array. Assuming all files in one place
filelist=( $(find . maxdepth 1 type f) ) #array of files
awk v count="${#filelist[@]}" '{value[$1]++}END{for(i in value){
if(value[i]==count){printf "Value %d is found in all files\n",i}}}' "${filelist[@]}"

Is it possible to multiply all of each column in matrix A by each column of matrix B without for loop?
By : de_dust
Date : March 29 2020, 07:55 AM
like below fixes the issue Seems like a perfect fit for np.einsum, as we need to the keep the first axis aligned between the two inputs and keep it in the output  code :
np.einsum('ij,ik>ki',V,W)
In [2]: W = np.random.randint(4,6, size=(6, 4))
...: H = np.random.randint(1,3, size=(4, 5))
...: V = np.dot(W,H) + 1
...: keep = np.array([]).reshape(0,6)
...:
In [5]: group = W.shape[1]
...: for k in xrange(group):
...: # multiply all of each column of V by kth column of W and sum in row
...: keep = np.vstack([keep, sum(V[:,:].T*W[:,k])])
...:
In [6]: np.allclose(keep, np.einsum('ij,ik>ki',V,W))
Out[6]: True

