This file contains hidden or 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 <string> | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <algorithm> | |
#include <cassert> | |
using namespace std; | |
////////////////////////////////////////////////////// | |
// Finding restriction sites (reverse palindromes) // |
This file contains hidden or 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 <string> | |
#include <iostream> | |
#include <cassert> | |
using namespace std; | |
string complement(string s) | |
{ | |
string n; | |
string out_string; | |
// loop through s in reverse order |
This file contains hidden or 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 <vector> | |
#include <iostream> | |
using namespace std; | |
// insertion-sort integers given from stdin | |
int main() | |
{ | |
// create vector of integers | |
vector<signed int> v; | |
signed int input, tmp, idx; |
This file contains hidden or 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
import os | |
import pandas as pd | |
# get the file paths | |
my_path = "path/to/output" | |
# stolen from stack overflow | |
def get_filepaths(directory): | |
"""Get full filepaths of all files in a directory, including sub-directories""" |
This file contains hidden or 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 <iostream> | |
using namespace std; | |
// hamming distance between two strings | |
int main() | |
{ | |
string s1, s2; | |
cin >> s1; | |
cin >> s2; | |
This file contains hidden or 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 <string> | |
#include <algorithm> | |
#include <iostream> | |
using namespace std; | |
// reverse complement of a DNA string | |
int main() | |
{ | |
string s; | |
cin >> s; // input from stdin |
This file contains hidden or 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
out_file = open("/home/scott/just_files.txt", "w") | |
for line in open("out_test.txt", "r").readlines(): | |
out_file.write(line.split("/")[-1]) |
This file contains hidden or 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
for i in {1..100}; do "qsub script_$i"; done | |
# can specify intervals in braces | |
# e.g {1..100..2} for 1,3,5...100 and so on. |
This file contains hidden or 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
find . -type f |
This file contains hidden or 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
sed '/string to match/d' ./file_to_remove_from.txt > output_file.txt |