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
// Clear form | |
function ClearCell(){ | |
var ss = SpreadsheetApp.getActiveSpreadsheet() | |
var formS = ss.getSheetByName("Form"); // Sheet name | |
var rangesToClear = ["B3","B6","B8","B10","D6","D8","D10"]; // List of cells to clear | |
for (var i=0; i<rangesToClear.length; i++){ | |
formS.getRange(rangesToClear[i]).clearContent(); | |
} | |
} |
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 csv | |
filtered_set = set() | |
with open('filtered_RNA_V3.txt','r') as fitlered_whitelist: | |
csv_reader = csv.reader(fitlered_whitelist, delimiter=',') | |
for cell_barcode in csv_reader: | |
filtered_set.add(cell_barcode[0].strip('-1').strip()) |
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 string | |
import regex | |
import numpy as np | |
test = 'AGCTAGCTGANNNNNAGCTANNNNNAGCTAGCTAGXXXXXXXXXX' | |
def generate_regex(barcode_template, positions, number_mismatches): | |
final_regex = '(?:' | |
position = 0 |
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
def create_file_id(file_path, block_size=256): | |
''' | |
Function that takes a file and returns the first 10 characters of a hash of | |
10 times block size in the middle of the file | |
Input: File path as string | |
Output: Hash of 10 blocks of 128 bits of size as string plus file size as string | |
''' | |
file_size = os.path.getsize(file_path) | |
start_index = int(file_size / 2) | |
with open(file_path, 'r') as f: |