This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Sep 28 17:14:18 2022 | |
@author: silvia | |
@description: sometimes qiime input (for pick_otus.py) is too heavy of a file. | |
Therefore you need to split it and obtain several output OTU files. But you can't | |
just paste together the outputs again, since it would mean repeated OTU IDs. So... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_folder="old_results_2023-04-13" | |
destination_folder="new_results_2023-05-30" | |
for file in "$source_folder"/*; do | |
filename=$(basename "$file") | |
destination_file="$destination_folder/$filename" | |
if [[ -e "$destination_file" ]]; then | |
source_size=$(stat -c%s "$file") | |
destination_size=$(stat -c%s "$destination_file") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## BASED ON : https://www.baeldung.com/linux/split-file-at-line-numbers | |
INPUT_FILE="out/experimental_reads.wig" # The input file | |
LINE_NUMBERS=( $(cat $INPUT_FILE | grep -n "g" | cut -f 1 -d":" | tr '\n' ' ') ) # The given line numbers (array) | |
START=1 # The offset to calculate lines | |
IDX=1 # The index used in the name of generated files: file1, file2 ... | |
for i in "${LINE_NUMBERS[@]}" | |
do | |
# Extract the lines using the head and tail commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(int argc,char** argv) | |
{ | |
int span=1; | |
int start=0; | |
int step=0; | |
char line[BUFSIZ]; |